Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Reversing of list through STDIN

by Lawliet (Curate)
on Jul 05, 2013 at 17:44 UTC ( #1042751=note: print w/replies, xml ) Need Help??


in reply to Reversing of list through STDIN

Au contraire, it seems to, indeed, reverse the order of the lines:

$ perl rev.pl Enter some lines, then press Ctrl-D: test 123 done

Output:

done 123 test

Perhaps you are interpreting the meaning of "reverse" differently. What, exactly, are you expecting for output?

(By the way, it is good practice to use warnings; use strict; in your perl programs. Doing so will save you time in the long run by catching silly mistakes while improving your coding habits.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1042751]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2018-05-20 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?