in reply to XML::Simple question
'batch-member' is hash reference, and not an array reference. Check the three lines after the while loop dereferencing $i:my $xmlconfig = { 'order' => { 'item-info' => { 'batch' => { 'batch-member' => { 'aid' => {} } } } } };
while(my $batch_aid = $xmlconfig->{order}->{'item-info'}->{batch}->{'b +atch-member'}->{aid}){ my $batch_pii = $xmlconfig->{order}->{'item-info'}->{batch}->{'batch +-member'}->{$i}->{'pii'}; my $batch_pit = $xmlconfig->{order}->{'item-info'}->{batch}->{'batch +-member'}->{$i}->{'pit'}; my $batch_doi = $xmlconfig->{order}->{'item-info'}->{batch}->{'batch +-member'}->{$i}->{'doi'}; $orderin{$batch_aid} = { 'pit' => $batch_pit, 'pii' => $batch_pii, 'doi' => $batch_doi, }; my $Eextra=''; $i++; $orderin{subitem}='Yes'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML::Simple question
by raj_monk (Novice) on Aug 02, 2009 at 11:37 UTC |