http://www.perlmonks.org?node_id=1038186


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