in reply to Mapping array over a hash

I believe that you're running into operator precedence problems between the 'if' modifier and the => operator. Instead, try a grep in there as well:
my %hash2 = map { $_ => $hash1{$_} } grep { defined $hash1{$_} } @ary;
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Replies are listed 'Best First'.
Re: Re: Mapping array over a hash
by agoth (Chaplain) on Jul 20, 2001 at 18:02 UTC
    It came to me about a minute after you'd posted, after about an hour of faffing, thanks anyway!!!!
    grep is the answer!