perl -e '%h = map{split /X/} q{fooXbar}, q{bishXbash}; print qq{$_ -> $h{$_}\n} for jeys %h;'
produces
bish -> bash foo -> bar
If you have to add another key/value pair subsequently you will have to use intermediate variables to avoid the clobber.
Cheers,
JohnGG
In reply to Re: Assign (key, value) to a hash w/o clobbering hash
by johngg
in thread Assign (key, value) to a hash w/o clobbering hash
by Melly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |