Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Basic I/O #2

by vroom (His Eminence)
on Nov 17, 1999 at 03:06 UTC ( [id://996]=note: print w/replies, xml ) Need Help??


in reply to Basic I/O Exercises

# Read lines until a line consisting only of "." is seen. # Then print the lines back out in the opposite order. my @lines; while ( $line = <> and $line ne ".\n" ) { push @lines, $line; } foreach ( reverse @lines ) # only reverses the list used by foreach; d +oes not modify the array { print; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://996]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-26 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found