in reply to Hash: Removing a specific value from a multi-valued key
Use:%hashA = ( '11.5' => [ 1723478, 1734789, 1798761, ], '11.12' => [ 1700123, ], '11.01' => [ 1780345, ] );
or@{$hashA{q/11.5/}} = [ grep { $_ != 1734789 }, @{$hashA{q/11.5/}} ];
my $id = q/11.5/; @{$hashA{$id}} = [ grep { $_ != 1734789 }, @{$hashA{$id}} ];
Update:
Added re/correct definiiton of %hashA
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash: Removing a specific value from a multi-valued key
by eshwar (Novice) on Oct 01, 2009 at 00:21 UTC | |
by toolic (Bishop) on Oct 01, 2009 at 00:31 UTC |