Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Reading from a file

by thinker (Parson)
on Aug 26, 2003 at 09:56 UTC ( #286640=note: print w/replies, xml ) Need Help??


in reply to Reading from a file

Hi itzMe,

If you want to be able to access the contents of the file again after initially reading it, slurp it into an array. This is as simple as

open FILE, "sample.txt" or die $!; my @lines = <file1>;

Now you can use @lines in whatever way you want.

Hope this helps

thinker

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2016-12-06 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (115 votes). Check out past polls.