in reply to hash problem
I'm sure I saw this done without the temp var $x once?
my @a = qw[ one two three ]; my $x = 1; $hash = {}, $hash->{ $_ } = $x, $x = $hash for reverse @a; print Dumper $hash; $VAR1 = { 'one' => { 'two' => { 'three' => 1 } } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hash problem
by dave_the_m (Monsignor) on Jul 09, 2004 at 20:47 UTC | |
by BrowserUk (Patriarch) on Jul 09, 2004 at 20:50 UTC |