Re: XML::Simple Problem
- From: "harryfmudd [AT] comcast [DOT] net" <"harryfmudd [AT] comcast [DOT] net">
- Date: Fri, 17 Feb 2006 06:52:39 -0500
Kodiak wrote:
Hi Tom,
I am somewhat of a newbie at perl so I do nto know how to check if the
hash reference is already parsed. I would like to know how do you
convert the hash reference into useable perl variables you can
manipulate. Thanks!
The output of
print Dumper ($dataResult);
should tell you what you're working with.
The short answer is that you can't usefully unload the hash until you know what keys are in it. You can dump it (that's what the Dumper was about), see what's there, and then figure out what to do with it.
For unloading the hash reference, see
$ perldoc perlreftut
(that's "Perl reference tutorial"). See also
$ perldoc perlref
Basically if you want key foo, do
$dataResult->{'foo'}
If foo turns out to be a list reference and you want element 2 of the list,
$dataResult->{'foo'}[2]
If foo turns out to be a hash reference and you want element bar,
$dataResult->{'foo'}{'bar'}
Tom Wyant
.
- Follow-Ups:
- Re: XML::Simple Problem
- From: Kodiak
- Re: XML::Simple Problem
- References:
- XML::Simple Problem
- From: Kodiak
- Re: XML::Simple Problem
- From: harryfmudd [AT] comcast [DOT] net
- Re: XML::Simple Problem
- From: Kodiak
- XML::Simple Problem
- Prev by Date: Re: VC++ Application Connecting PostgreSQL on Linux
- Next by Date: Math::GMP Make Test error on Itanium running HP-UX 11.23
- Previous by thread: Re: XML::Simple Problem
- Next by thread: Re: XML::Simple Problem
- Index(es):
Relevant Pages
|
|