in reply to Re^3: Howto Avoid Memory Problem in List::MoreUtils
in thread Howto Avoid Memory Problem in List::MoreUtils

$last is used to remove dups. $last needs to be set to the $e of this pass to compare it to the $e of the next pass. I suppose you could get rid of $last and do
@array = sort @array; my $j = -1; for my $e (@array) { if ($j < 0 || $array[$j] ne $e) { $array[++$j] = $e; } } $#array = $j;