in reply to Re: hash problem
in thread hash problem

Seconded.

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...