in reply to Re: xml simple not a hash reference
in thread xml simple not a hash reference
Thank you for the responses. This is my code:
my $results = $res->content; $xml = new XML::Simple (KeyAttr => [],suppressempty => 1,ForceArray => + ['roomtype']); $data = $xml->XMLin("$results"); foreach $e (@{$data->{data}->{bb}->{roomtypes}->{roomtype}}){ $roomtypename=$e->{roomtypename}; $rateid=$e->{mealtypes}->{mealtype}->{rateid}; }
I only receive the error when trying to get the value of rateid for the mealtype, if it is more than one, and I don't know how to loop through the mealtypes
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: xml simple not a hash reference
by Anonyrnous Monk (Hermit) on Dec 28, 2010 at 15:00 UTC | |
by Noverast (Initiate) on Dec 29, 2010 at 07:40 UTC | |
by morgon (Priest) on Dec 29, 2010 at 07:51 UTC | |
by Anonymous Monk on Dec 29, 2010 at 09:10 UTC | |
by Noverast (Initiate) on Dec 29, 2010 at 08:09 UTC | |
by Noverast (Initiate) on Dec 29, 2010 at 08:27 UTC | |
by Anonymous Monk on Dec 29, 2010 at 06:22 UTC |
In Section
Seekers of Perl Wisdom