mhearse has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to reassign it like this, but it must be broken:$VAR1 = { 'one' => [ '1234', '5678', ], 'two' => [ '91011', '121314', ], 'three' => [ '151617', '181920', '212223', ] };
my %hash; for my $key (keys %tmp) { $hash{$key} = { $key => @{$tmp{$key}} }; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help reassigning hash with arrayref
by GrandFather (Saint) on Nov 15, 2011 at 22:59 UTC | |
by mhearse (Chaplain) on Nov 15, 2011 at 23:25 UTC | |
by GrandFather (Saint) on Nov 15, 2011 at 23:29 UTC | |
by mhearse (Chaplain) on Nov 16, 2011 at 00:07 UTC | |
by Anonymous Monk on Nov 16, 2011 at 02:34 UTC | |
|
Re: help reassigning hash with arrayref
by johnny_carlos (Scribe) on Nov 15, 2011 at 23:00 UTC | |
by GrandFather (Saint) on Nov 15, 2011 at 23:26 UTC |