in reply to Array to nested hash
Prints..use Data::Dumper; my $a; sub x{ my $ar=$_[1]; my $v=shift @$ar or return $_[0]=undef; x($_[0]->{$v} , $ar) }; x($a,[5,3,4,5,6]); print Dumper \$a;
$VAR1 = \{ '5' => { '3' => { '4' => { '5' => { '6' => undef } } } } };
Earth first! (We'll rob the other planets later)
|
|---|