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.
In reply to Re: Hash multiple initialization
by ikegami
in thread Hash multiple initialization
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |