If you'd prefer not to roll your own, I've got a similar function in my Data::DRef module on CPAN:
use Data::Dref qw( set_value_for_keys ); my %hash; set_value_for_keys( \%hash, 1, qw(a b c d) ); set_value_for_keys( \%hash, 1, qw(a c d e) );
There's also a corresponding get_value_for_keys function, if needed...
In reply to Re^2: hash problem
by simonm
in thread hash problem
by m.y
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |