Just a matter of idle curiosity... I notice you use @$ref-1 instead of $#$ref for obtaining the max array index. Why do you prefer this? If $[ were ever changed (but don't do that!), @$ref-1 would yield an incorrect value for max index. (Although I suppose that one could argue that to be $[-safe, one ought always to iterate over $[ .. $#array rather than 0 .. $#array to safely visit the entire range of @array indices.)
Also, in your second code example
splice @$ref,-$removed;
might be written as the (presumably) marginally faster
$#$ref -= $removed;
Update: I should make it clear that this post was prompted mainly by the non-idiomatic nature of the @$ref-1 expression. Any "lack-of-safety" issue is only a kind of cayenne pepper icing on the cake.
In reply to Re^2: removing duplicates from an array of hashes
by AnomalousMonk
in thread removing duplicates from an array of hashes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |