I am studying the examples in the book "Perl 5 by Examples". Here's a
short program from that book:
my $dbf2 = { 3 => { 4=>5, 5=>6 } };
my($key1,$value1,$key2,$value2);
while (($key1,$value1) = each(%{$dbf2})) {
print("level 1: $key1 => $value1\n");
while(($key2,$value2) = each(%{$value1})) {
print("level 2: $key2 => $value2\n");
}
}
The program would prints:
Level 1: 3 => HASH(123456)
Level 2: 4 => 5
Level 2: 5 => 6
Now, what if I create this (which passed the compilation):
my $dbf3 = { { 4=>5, 5=>6} }
How could I make the same program work?
--
.~. Might, Courage, Vision. In Linux We Trust.
/ v \ http://www.linux-sxs.org
/( _ )\ Linux 2.4.22-xfs
^ ^ 4:54pm up 2 days 18:48 load average: 1.00 1.00 1.00