in reply to How to populate array with lines from text file? (Moved from Q&A)
Since <FH> is in array context ie. the left hand side of the assignment expects a list of items, it will fill the array with all the lines in the file.open (FH, "< $file") or die "Can't open $file for read: $!"; my @lines = <FH>; close FH or die "Cannot close $file: $!";
|
|---|