[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] All these new updates to MacPerl...



>> At 06.48 98.01.11, Amitava Basu wrote:
>>[snip]
>> >#!/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";
>> >}
>>[snip]
>
>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?
>
>George

I use MPW all the time, and there's nothing wrong with your setup. Any
request for standard input from MPW is satisfied by whatever you have
selected at the time you press Enter, or by the entire line the I-beam is
on if nothing is selected. This is normally great but occasionally
surprising: remember, the Worksheet is *not* a terminal.

BTW, I consider this reasonably on-topic because I at least use MacPerl
always and only from MPW -- and I heartily recommend it! But... does
someone know if it's possible to keep the MacPerl Tool going in the
background somehow? I find that with small MacPerl scripts it often takes
far longer to load the interpreter than it does to execute the script.

Jason


___________________________
Dr Jason Johnston
mailto:jcj@mail.usyd.edu.au
http://www-personal.usyd.edu.au/~jcj
fax: +61 2 9519 6184



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch