sub make_hash { my $keys= shift; return 1 unless $keys and @$keys; + my $key= shift @$keys; + return { $key => make_hash( $keys ) }; } + my $hash= make_hash( [qw(one two three)] ); + use Data::Dumper; print Dumper $hash; + __END__ $VAR1 = { 'one' => { 'two' => { 'three' => 1 } } };
In reply to Re: hash problem
by sacked
in thread hash problem
by m.y
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |