Restriction to the set:
%h1=( 1=>"one", 2 => "two", 3 => "three", 4 => "four"); @set=(1, 3, 5, 7); my %h2; $h2{$_} = $h1{$_} for grep exists $h1{$_}, @set;
Restriction by the set:
%h1=( 1=>"one", 2 => "two", 3 => "three", 4 => "four"); @set=(1, 3, 5, 7); my %h2 = %h1; delete $h2{$_} for grep exists $h1{$_}, @set;
What about the same for values? (restrict the range to the set and by the set)?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Mapping restrictions
by merlyn (Sage) on Sep 14, 2000 at 18:34 UTC | |
by brother ab (Scribe) on Sep 15, 2000 at 09:23 UTC | |
|
RE: Mapping restrictions
by runrig (Abbot) on Sep 14, 2000 at 20:44 UTC | |
by runrig (Abbot) on Sep 16, 2000 at 00:10 UTC |