Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2018-10-16 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (89 votes). Check out past polls.

    Notices?