in reply to Reversing A File
Note that if you want to use less memory, you could split the file into chunks, reverse the chunks and then reverse-concatenate the chunks.my @input = <STDIN>; my $i = $#input; while ($i >= 0) { print $input[$i--]; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reversing A File
by camelcom (Sexton) on Dec 12, 2007 at 14:06 UTC |