Much easier with grep.
--@new_array = @hash{ grep { exists $hash{$_} } @array };
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: comparing array elements to hash keys
by davorg
in thread comparing array elements to hash keys
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |