in reply to Mapping restrictions

Just for variety, another way to do the first one:

my %h2 = map { $_ => $h1{$_} } grep { exists $h1{$_} } @set;

Replies are listed 'Best First'.
RE: RE: Mapping restrictions
by runrig (Abbot) on Sep 16, 2000 at 00:10 UTC
    And yet another:

    my %h2 = map { exists $h1{$_} ? ($_ => $h1{$_}) : () } @set;