Noverast has asked for the wisdom of the Perl Monks concerning the following question:
I can loop through each roomtype but if a roomtype has more that one mealtype I get this error: The ForceArray option is enabled. Please Help!
gives me this error message / faulty output:
Not a HASH reference
This is the dump from the XML that is begin returned to me:
$VAR1 = { 'success' => 'true', 'data' => { 'bb' => { 'roomtypes' => { 'roomtype' => [ { 'rtimage' = +> '10002-2.jpg', 'ratescheme +' => '1', 'rtid' => ' +2', 'roomsfree' + => '2', 'childpolic +y' => { + 'general' => '2 - 12 years stay', + 'allowchild2' => 'Y', + 'allowchild1' => 'Y' + }, 'mealtypes' + => { + 'mealtype' => [ + { + 'defaultmealtype' => 'true', + 'rates' => { + 'pax3' => '1180.00', + 'pax2' => '930.00', + 'pax4' => '1405.00', + 'pax1' => '550.00' + }, + 'mealtypedesc' => 'Bed & Breakfast', + 'rateid' => '6' + }, + { + 'rates' => { + 'pax3' => '850.00', + 'pax2' => '700.00', + 'pax4' => '975.00', + 'pax1' => '450.00' + }, + 'mealtypedesc' => 'Self-catering', + 'rateid' => '7' + } + ] + }, 'maxoccupan +cy' => '6', 'minlos' => + '0', }, { 'ratescheme +' => '1', 'rtid' => ' +1', 'roomsfree' + => '5', 'descriptio +n' => 'Double bed', 'childpolic +y' => { + 'general' => '2 - 12 years stay', + 'allowchild2' => 'Y', + 'allowchild1' => 'Y' + }, 'mealtypes' + => { + 'mealtype' => { + 'defaultmealtype' => 'true', + 'rates' => { + 'pax2' => '800.00', + 'pax1' => '500.00' + }, + 'mealtypedesc' => 'B&B', + 'rateid' => '5' + } + }, 'maxoccupan +cy' => '2', 'minlos' => + '0', } ] }, }, 'nights' => '1', 'enddate' => '2011-01-24', 'startdate' => '2011-01-23' } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: xml simple not a hash reference
by Anonyrnous Monk (Hermit) on Dec 28, 2010 at 11:29 UTC | |
|
Re: xml simple not a hash reference
by roboticus (Chancellor) on Dec 28, 2010 at 13:17 UTC | |
by Noverast (Initiate) on Dec 28, 2010 at 13:50 UTC | |
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 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 | |
|
Re: xml simple not a hash reference
by Jenda (Abbot) on Dec 29, 2010 at 14:06 UTC |