|Perl: the Markov chain saw|
Hash slicesby Marcello (Hermit)
|on Feb 17, 2004 at 12:53 UTC||Need Help??|
Marcello has asked for the wisdom of the Perl Monks concerning the following question:
Say I have a hash like this:
Now I want to create a new hash with only those keys/values where the key =~ m/^NETWORK/
So keys matching /^NETWORK/:
And keys matching /^TYPE/:
The problem is... how?
Two functions come to mind: grep and map, but I am not sure how to use those to get to hash slices above.