in reply to Hash multiple initialization
New hash:
my %hash = ( ( map { $_=>'toto' } qw( a b c f t u ) ), ( map { $_=>'titi' } qw( b g k p ) ), );
Existing hash:
$hash{$_} = 'toto' for qw( a b c f t u ); $hash{$_} = 'titi' for qw( b g k p );
You have "b" twice, which means one (the earlier one) will get erased.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash multiple initialization
by AnomalousMonk (Archbishop) on Oct 08, 2008 at 20:13 UTC | |
by ikegami (Patriarch) on Oct 09, 2008 at 01:13 UTC |