Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: reading lines into an array

by vinoth.ree (Parson)
on Jun 11, 2013 at 03:24 UTC ( #1038186=note: print w/ replies, xml ) Need Help??


in reply to reading lines into an array

davido ++

use File::Slurp; my @lines = read_file("filename", chomp => 1); # will remove newline f +rom each line
This is the easiest method to each file content into array. If you need some validation for each line you can use grep in front of read_file.

More on reading file content into array,
how can we read each line from a file onto an array?


All is well


Comment on Re: reading lines into an array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-09-24 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (246 votes), past polls