Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

File I/O #1

by vroom (His Eminence)
on Nov 19, 1999 at 02:08 UTC ( [id://1009]=note: print w/replies, xml ) Need Help??


in reply to File Input and Output Exercises

# prompt the user for the name of a source file, and # read all the lines from that file. # Then print out the lines in reverse order. print "What is the name of the source file? "; my $file = <>; chomp $file; open FILE, "< $file" or die "error reading $file - $!"; while ( <FILE> ) { push @lines, $_; } close FILE; foreach ( reverse @lines ) { print; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found