in reply to Hash slices
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Hash slices
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 |