J
Jeff
I've created a beast! Here is my data structure:
$VAR1 = 'bunkers';
$VAR2 = {
'items' => [
\[
{
'archie' => 'conservative'
}
],
\[
{
'meathead' => 'liberal'
}
]
]
};
$VAR3 = 'simpsons';
$VAR4 = {
'items' => [
\[
{
'haha' => 'nelson munce'
}
],
\[
{
'whoohoo' => 'homer simpson'
}
]
]
};
How do I access the hash key value pairs? This fails at runtime:
(Not a HASH reference at haha line 22.)
foreach $key (keys %hash){
print "[".$key."]\n";
for $who (@{$hash{$key}{items}}){
foreach $item (keys %{$who}){
print $item . " => " . $who->{$item} . "\n";
}
}
}
TIA,
Jeff
$VAR1 = 'bunkers';
$VAR2 = {
'items' => [
\[
{
'archie' => 'conservative'
}
],
\[
{
'meathead' => 'liberal'
}
]
]
};
$VAR3 = 'simpsons';
$VAR4 = {
'items' => [
\[
{
'haha' => 'nelson munce'
}
],
\[
{
'whoohoo' => 'homer simpson'
}
]
]
};
How do I access the hash key value pairs? This fails at runtime:
(Not a HASH reference at haha line 22.)
foreach $key (keys %hash){
print "[".$key."]\n";
for $who (@{$hash{$key}{items}}){
foreach $item (keys %{$who}){
print $item . " => " . $who->{$item} . "\n";
}
}
}
TIA,
Jeff