Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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?
[chacham]: Re: Re: pattern matching -- feeling stoopit a poll idea about centrists, is +8 -5, used to be +6/-6 how apropos :)is +8
[chacham]: ...errr... Re: poll ideas quest 2015 (political centrist)
[chacham]: ooh, late, nighty nite everybody
[jdporter]: thanks, 1nickt1

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (13)
As of 2017-05-24 21:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?