For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Beginners > November 2006 > Pseudo-hashes are deprecated 5.8.0 So how do we use XML::Simple now?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Pseudo-hashes are deprecated 5.8.0 So how do we use XML::Simple now?
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?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com