in reply to Re: Hash slices
in thread Hash slices
which is fancy-looking, non-map-in-a-void-context way of saying:my %hash2; map { $hash2{$_} = $hash{$_} if /^NETWORK/ } keys %hash;
My rough check with Benchmark shows no difference between map...grep and map alone until the hash sizes were increased to force memory paging to disk.my %hash2; { $hash2{$_} = $hash{$_} if /^NETWORK/ } foreach keys %hash;
[I didn't check to see if anything was optimized away.]
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Hash slices
by revdiablo (Prior) on Feb 17, 2004 at 22:28 UTC | |
by QM (Parson) on Feb 17, 2004 at 23:45 UTC |