in reply to reading several lines in a gulp
my @lines; push @lines, scalar <$file> for 1..10;
No need for a primitive for something that can be easily achieved with existing primitives, and isn't used all that often.
Perl buffers the data it reads from the file, so it shouldn't be much less efficient than slurping a small file in list context.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: reading several lines in a gulp
by John M. Dlugosz (Monsignor) on Apr 27, 2011 at 12:31 UTC | |
by moritz (Cardinal) on Apr 27, 2011 at 13:00 UTC | |
|
Re^2: reading several lines in a gulp
by raybies (Chaplain) on Apr 27, 2011 at 12:20 UTC | |
by moritz (Cardinal) on Apr 27, 2011 at 12:58 UTC | |
by Eliya (Vicar) on Apr 27, 2011 at 12:58 UTC |