Untested:
my $p= \%hash; my $last= pop @splittedline; foreach @splittedline { $p->{$_}={} if (not exists $p->{$_}); $p= $p->{$_}; } $p->{$last}= 1;
I'm sure someone else will find a more elegant solution ;-). (though I don't consider the obvious solution with eval elegant)
In reply to Re: Array to Hash of Hashes
by jethro
in thread Array to Hash of Hashes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |