go ahead... be a heretic | |
PerlMonks |
Re: Re: comparing array elements to hash keysby dvergin (Monsignor) |
on Jul 03, 2003 at 19:53 UTC ( [id://271273]=note: print w/replies, xml ) | Need Help?? |
I was going to suggest:
It's tempting to just say my @ary2 = @hash{@ary}. But the values in @ary that don't match keys in %hash produce undefined values that have to be weeded out. Here's a quick demo:
In Section
Seekers of Perl Wisdom
|
|