Note, however, that the set sub does not do auto vivification of hash keys for you. This might be regarded a feature, but probably isn't.# traverse($hoh, @key): return value of $hoh->{$key[0]}...{$key[-1]} sub traverse { my $hoh = shift; $hoh = $hoh->{$_} for (@_); $hoh } # set($hoh,$val, @path): ... sub set { my $hoh = shift; my $val = shift; my $last = pop @_; $hoh = $hoh->{$_} for (@_); $hoh->{$last} = $val }
In reply to Re: Hash to Hash to Hash ....
by ariels
in thread Hash to Hash to Hash ....
by wertert
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |