Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
print "Enter your data and then it will print out in reverse order.\n +"; @input = <stdin>; chop (@input); $currentline = 1; while($currentline <= @input) { @words=split(/ /,$input[$currentline - 1]); #@words=reverse(@words); $input[$currentline - 1]=join(" ",@words,"\n"); last if $input eq 'done'; $currentline++; } @input=reverse(@input); print(@input);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ending user input
by broquaint (Abbot) on May 28, 2002 at 12:46 UTC | |
by Anonymous Monk on May 28, 2002 at 17:20 UTC | |
|
Re: Ending user input
by vladb (Vicar) on May 28, 2002 at 12:55 UTC | |
by Anonymous Monk on May 28, 2002 at 17:24 UTC | |
by DigitalKitty (Parson) on May 28, 2002 at 19:49 UTC |