in reply to Re: removing repeated elements from one array
in thread removing repeated elements from one array
And for this to make sense the array elements must all be references to objects - if some elements are strings its possible for them to be equal to and overwrite a stringified reference.my %hash = map { $_ => $_ } @array; # then... my @unique_unordered = values %hash; my @unique_ordered = grep {defined} map { delete $hash{$_} } @array;
|
|---|