in reply to Reversing A File
Probably it is not the fastest way, but Tie::File should work
use Tie::File; my $file = shift @ARGV; tie my @data, 'Tie::File', $file or die $!; tie my @reversed, 'Tie::File', $file."rev" or die $!; @reversed = reverse(@data); untie @data; untie @reversed;
Tie::File doesn't load the file into memory, it indexes it, so this should work even for very big files
citromatik
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reversing A File
by ikegami (Patriarch) on Dec 12, 2007 at 13:09 UTC | |
by camelcom (Sexton) on Dec 12, 2007 at 13:40 UTC | |
by marto (Cardinal) on Dec 12, 2007 at 13:50 UTC | |
by runrig (Abbot) on Dec 12, 2007 at 15:42 UTC |