Marcello has asked for the wisdom of the Perl Monks concerning the following question:
Now I want to create a new hash with only those keys/values where the key =~ m/^NETWORK/my %hash = ("NETWORK1" => "A", "NETWORK2" => "B", "TYPE1" => "C", "TYP +E2" => "D");
And keys matching /^TYPE/:my %hashslice1 = ("NETWORK1" => "A", "NETWORK2" => "B");
The problem is... how?my %hashslice2 = ("TYPE1" => "C", "TYPE2" => "D");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash slices
by Roger (Parson) on Feb 17, 2004 at 12:59 UTC | |
|
Re: Hash slices
by QM (Parson) on Feb 17, 2004 at 19:02 UTC | |
|
Re: Hash slices
by revdiablo (Prior) on Feb 17, 2004 at 19:16 UTC | |
by QM (Parson) on Feb 17, 2004 at 21:56 UTC | |
by revdiablo (Prior) on Feb 17, 2004 at 22:28 UTC | |
by QM (Parson) on Feb 17, 2004 at 23:45 UTC |