in reply to Hash of hashes assignment
use strict; use warnings; use Data::Dumper; my %hash = ( Sun => 'day', Moon => 'night', ); my %hoh; $hoh{correct} = { %hash }; $hoh{wrong} = %hash; print Dumper \%hoh;
Output:
$VAR1 = { 'correct' => { 'Moon' => 'night', 'Sun' => 'day' }, 'wrong' => '2/8' };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hash of hashes assignment
by Anonymous Monk on Apr 12, 2013 at 16:33 UTC | |
by johngg (Canon) on Apr 12, 2013 at 22:02 UTC |