Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
so i want the result to look like :
this snippet of code doesn't work. why?$hashREF->{$key0}->{$key1}->{$key2} = $hashVAL
my $list = [ "k0", "k1", "k2", ]; my ($h,$t); foreach my $k ( @$list ) { $h->{$k} = {}; $h = $h->{$k}; } $h = $val;
thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: adding keys to a hash
by kyle (Abbot) on Mar 29, 2008 at 02:14 UTC | |
|
Re: adding keys to a hash
by Fletch (Bishop) on Mar 29, 2008 at 02:15 UTC |