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;
In reply to Re^2: removing repeated elements from one array
by Akhasha
in thread removing repeated elements from one array
by perlbeginner10
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |