A while loop over a filehandle like while(my $line = <$fh>) { ... } reads the file line-by-line* (one line is read on each iteration of the loop), as opposed to foreach my $line (<$fh>) { ... } or my @lines = <$fh>;, which reads the entire file first (obviously not particularly friendly on memory for large inputs).
For more information, see I/O Operators in perlop and readline.
* Perl's definition of what a "line" is may be changed via the input record separator $/.
... since I only work with CSV files.
I will definitely look into the Text::CSV module...
Yes! ;-)
In reply to Re^3: Find data point generating Error in Perl code
by Anonymous Monk
in thread Find data point generating Error in Perl code
by kgherman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |