in reply to How to find and remove duplicate elements from an array?
use Tie::IxHash; sub removeDuplicates { tie my %tempHash, 'Tie::IxHash'; $tempHash{$_}++ for @_; keys %tempHash; } # Remove repeated elements from an array my @array1 = qw( 4 3 7 4 3 8 9 12 23 43 23 12 ); my @uniqArray = removeDuplicates( @array1 ); print "@uniqArray";
|
|---|