use Data::Dumper; use strict; use warnings; my @foo = qw[1 2 3 4 5]; my $bar; for ($_ = $#foo; $_ >= 0; $_--) { $bar = {$foo[$_], $bar}; } print Dumper($bar);
In reply to Re: Array to nested hash
by TedPride
in thread Array to nested hash
by amw1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |