Adapted from (tye)Re: varying length multi-dimensional hashes:
sub setHoH { my( $hashref, $val, @keys )= @_; my $ref= \$hashref; for( @keys ) { $ref= \$$ref->{$_}; } $$ref= $val; } @array= qw/one two three/; setHoh( \%hash, 1, @array );
In reply to Re: How do I populate a ML hash from an array?
by tye
in thread How do I populate a ML hash from an array?
by unixdown
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |