Article 11320 of comp.lang.perl: Path: feenix.metronet.com!news.utdallas.edu!wupost!udel!news.sprintlink.net!news.world.net!news.teleport.com!desiree.teleport.com!merlyn From: merlyn@ora.com (Randal L. Schwartz) Newsgroups: comp.lang.perl Subject: Re: examples of WISH (X) programs Date: 08 Mar 1994 23:35:17 GMT Organization: Stonehenge Consulting Services; Portland, Oregon, USA Lines: 50 Message-ID: References: NNTP-Posting-Host: linda.teleport.com In-reply-to: laff@cs.uiuc.edu's message of Tue, 8 Mar 1994 22:38:27 GMT >>>>> "Joshua" == Joshua A Laff writes: Joshua> I've caught the program in the FAQ for using perl to access wish, but I'm Joshua> interested in some other examples. Does anyone have any or know where to find Joshua> some? (Specific files in the ftp.cis.ufl.edu archive would help - I couldn't Joshua> find an index that said "this is GUI" for anything). Sending them via e-mail Joshua> is okay if you like. Thanks in advance. [tchrist, I hope your Perl scanner finds this for the FAQ...] Here's my much shorter version of the FAQ program, using Tom's open2: #!/usr/bin/perl require 'open2.pl'; &open2(WISHR,WISHW,"wish","--") || die "Cannot wish: $!"; print WISHW <<'WISHEND'; proc echo {s} {puts stdout $s; flush stdout}; # This is a comment "inside" wish frame .f -relief raised -border 1 -bg green; pack append . .f {top fill expand}; button .f.button-pressme -text {Press me} -command { echo {That's nice.}; }; button .f.button-quit -text {quit} -command { echo {quit}; destroy .; # bye bye }; pack append .f .f.button-pressme {top fill expand} \ .f.button-quit {top expand}; WISHEND while () { chop; warn "Wish said: $_\n"; last if /^quit/; } Guess who's having to do some GUI stuff finally? :-) print "Just another Perl hacker," # and GUI-builder -- Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095 Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying Email: Snail/FAX: (Call) aka: Phrase: "Welcome to Portland, Oregon ... home of the California Raisins!"