On Tuesday, May 14, 2002, at 12:14 , Felix Geerinckx wrote:
>> sub PromptForBody {
.....
>> }
>>
>
> I would do it like this:
[..]
>     while (defined(my $thisLine = <STDIN>)) {
>         last if $thisLine eq ".\n";
>         push(@messageBody,$thisLine);
>         print ': ';
>     }
[..]

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? rather than say making a
flexible enough sub - ala

        sub DoCommandLineStuff {
                my ($prompt, $eom, $message_list) = @_;
        
                print "$prompt";
                while (<STDIN>) {
                last if $_ eq $eom ;            #we reached the end of message
                push(@$message_list,$_);
        }

        } # end of DoCommandLineStuff

http://www.wetware.com/drieux/pbl/Sys/commandLinePrompting.txt

or Why the complex

        defined(my $thisLine = <STDIN>)

is there some liability to the 'old dog' way of grovelling <STDIN> ???
expecially since we have an 'end of message' or 'end of 
mungingFromInfestationUnitParasiteAtEndOfTTYlineKeyBoardPoking'
to break us out of the 'waiting on STDIN' issue here????

ciao
drieux

---


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

Reply via email to