in reply to Removing Duplicates from Array Passed by Reference
That should do the trick.sub util_remove_duplicates { my %hash; undef %hash; @hash{ref $_[0] eq 'ARRAY' ? @{$_[0]} : @_} = (); return keys %hash; }
Update: and something that'll actually do what you requested
sub util_remove_duplicates { @{$_[0]} = keys %{ { map{$_=>1} @{$_[0]} } }; return; }
_________
broquaint
|
|---|