Roger has already provided a few solutions, and QM has a good answer, but here's another:
my %newhash1 = map { $_=>$hash{$_} } grep { /^NETWORK/ } keys %hash;
I'm not sure how all these compare in terms of speed, efficiency, etc. This is just how I'd do it for greatest clarity.
In reply to Re: Hash slices
by revdiablo
in thread Hash slices
by Marcello
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |