in reply to Ending user input
Also use chomp() instead of chop() as it does what you mean (which is remove the newline ending (which is system dependent (hence the use of $/ in the join() (gee, is this sounding a little Lispish? (Never mind)))))[1].my @input; while(<STDIN>) { chomp; last if $_ eq 'done'; push @input, $_; } print join $/, reverse @input;
_________
broquaint
[1] shamelessly lifted from perlsub ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Ending user input
by Anonymous Monk on May 28, 2002 at 17:20 UTC |