in reply to Assign (key, value) to a hash w/o clobbering hash
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
|
|---|