Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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


Comment on Re: Reading from a file
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-09-03 02:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls