in reply to comparing array elements to hash keys
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: comparing array elements to hash keys
by dvergin (Monsignor) on Jul 03, 2003 at 19:53 UTC |