Same problem with moritz's first solution. Needs to handle eof conditions:
@lines = map {eof($file) ? () : scalar <$file>}, 1..10;
In reply to Re^2: reading several lines in a gulp
by wind
in thread reading several lines in a gulp
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |