A
asincero
I have this:
use strict;
my %my_hash = ();
$my_hash{'1'}{'a'} = "Hello";
$my_hash{'1'}{'b'} = "world!";
$my_hash{'2'}{'c'} = "Foo";
$my_hash{'2'}{'d'} = "bar";
And I want to do something like this:
foreach my $k (keys $my_hash{'1'})
{
print "$k\n";
}
Should give the output of:
a
b
But of course the above code is wrong. How do I correct it?
Thanks.
-- Arcadio
use strict;
my %my_hash = ();
$my_hash{'1'}{'a'} = "Hello";
$my_hash{'1'}{'b'} = "world!";
$my_hash{'2'}{'c'} = "Foo";
$my_hash{'2'}{'d'} = "bar";
And I want to do something like this:
foreach my $k (keys $my_hash{'1'})
{
print "$k\n";
}
Should give the output of:
a
b
But of course the above code is wrong. How do I correct it?
Thanks.
-- Arcadio