in reply to Out of memory problem when copying contents of file into array
Another alternative:
#!/usr/bin/perl -w use strict; use IO::All; my @reversed_io = io("file.txt")->backwards->getlines; my @lines; push @lines, $reversed_io[$_] for ( 0 .. 100 );
|
---|
In Section
Seekers of Perl Wisdom