on Tue, 14 May 2002 16:11:00 GMT, [EMAIL PROTECTED] (Drieux) wrote:

> ok, I gotta Ask. is this just because you expect it
> is better for this to be 'inline' - and hence merely
> followed the basic form? 

No particular reason.

>rather than say making a flexible enough sub - ala
> 
>      sub DoCommandLineStuff {
>           my ($prompt, $eom, $message_list) = @_;
>      
>           print "$prompt";
>           while (<STDIN>) {
>               last if $_ eq $eom ;          
>               push(@$message_list,$_);
>           }
> 
>      } # end of DoCommandLineStuff

I would prefer to return an array(ref) here instead of passing an 
arrayref as parameter. 
 
> or Why the complex
> 
>      defined(my $thisLine = <STDIN>)

But this exactly equivalent to your 'while (<STDIN>) { ...}',
except that it uses an explicit loop variable instead of $_.
The 'defined' is necessary for the rare occasions where you have '0' 
as your last line, without trailing "\n", which would evaluate to 
false, but would still be defined.

-- 
felix

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to