This will work. the innermost key will point to an empty hashref.
Except it will clobber already existing keys/subhashes.
my @list=qw(a b c d e f g); my %hash; my $hptr=\%hash; $hptr = $hptr->{$_}||={} foreach @list;
Change that assignment to ||= and it works fine. :-)
In reply to Re: Re: From: array To: complex hash
by demerphq
in thread From: array To: complex hash
by markguy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |