| rupert@melbourne 2006-11-22, 3:55 am |
| As I under stood it, a pseudo hash is as follows;
$pseudohash = [{ foo => 1, bar => 2, baz => 3, qux => 4}, 10, 110,
1110, 11110, ];
so that
$pseudohash->[3] = 1110;
$pseudohash->[$pseudohash->[0]{baz}] = 1110;
are equivilent. Now i don't think that i'm actually using (at least
deliberatly) this in my program. In my program i've pased in a deep XML
tree, and have code that looks like the following;
if ($k2->{$k3}->{'ID'}){
#do stuff ...
}
else{
#do other stuff
}
i'm using the if statement so that if the data structure underneath is
of a the value;
scalar reference...
$VAR1 = 488
do one thing: or if a hash reference...
$VAR1 = [
{
'ID' => 510
},
{
'ID' => '481'
},
{
'ID' => '260'
},
{
'ID' => '271'
},
{
'ID' => '549'
}
];
# these are outputs from Data::Dumper so they are exactly right.
do another thing.
My problem is that upon falseifying the condition, the warning:
"Pseudo-Hash deprecated" occurs;
ie. everytime a hash reference is returned. My program works, but it
throws warnings. Any suggestions?
|