Install Sort::External from CPAN. It was written for the purpose of sorting huge files.
my $sortex = Sort::External->new(); while (<HUGEFILE>) { $sortex->feed($_); } $sortex->finish; my $prev = ''; while ( defined( $_ = $sortex->fetch ) ) { next if $_ eq $prev; print OUTFILE $_; $prev = $_; }
In reply to Re: 'sort -u' in perl
by creamygoodness
in thread 'sort -u' in perl
by sanPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |