At 12.16 98.01.11, George Michel wrote: >On Sun, 11 Jan 1998, Chris Nandor wrote: > >> At 06.48 98.01.11, Amitava Basu wrote: >> >I tried to run the first script from Learning MacPerl which goes >> >like this. I compiled the script under MacPerl 5.1or2. This has >> >been drawan from"Learning Perl" by Randal Schwartz and Tom >> >Christiansen. When I run the script it shows nothing other >> >than the "syntax" ok. Do I need to have a news version? >> > >> >#!/usr/bin/perl -w >> >print "What is your name?"; >> >$naem = <STDIN>; >> >chomp ($naem); >> >if ($name eq "Randal") { >> >print "Hello,Randal! How good of you to be here!\n"; >> >} else { >> >print "Hello, $name!\n"; >> >} >> >> >> Well, aside from your problem of $name vs. $name, this works fine under the >> current version of MacPerl (5.1.8r4). And while older versions of MacPerl >> are largely unsupported, your code above should work fine under older >> versions of MacPerl. That said, it sounds like instead of running the >> script you are checking its syntax. >> > >If I run this from MPW, having named it Filename and corrected $name, I >get: > >perl Filename >What is your name? gjm >Hello, What is your name? gjm! > >So STDIN gives the whole line? Is this standard or do I need to >change my setup? I am no expert in MPW, but this is purely an MPW phenomenon that I have not seen in the MacPerl app or any Unix shell I am familiar with. -- Chris Nandor pudge@pobox.com http://pudge.net/ %PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10 1FF7 7F13 8180 B6B6']) #== MacPerl: Power and Ease ==# #== Publishing Date: Early 1998. http://www.ptf.com/macperl/ ==# ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch