If you're just trying to remove duplicates from the array (which I'm not sure you are), you can do this:
my @array = getMatches();
my %tmp;
@tmp{@array} = (undef) x @array;
@array = keys %tmp;
undef %tmp;
This takes advantage of Perl's hash slices and can be incredibly useful for set-like operations.
Jerry Goure
In reply to Re: Answer: How can I assign the elements in an array to only the key values in a hash?
by Benedictine Monk
in thread How can I assign the elements in an array to only the key values in a hash?
by blackjudas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |