in reply to Re: From: array To: complex hash
in thread From: array To: complex hash

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


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...