in reply to Re^4: XML::Parser - Code Reference Error?
in thread XML::Parser - Code Reference Error?
It's a quite complex structure:print Dumper ($tmp);
$VAR1 = [ bless( { 'Kids' => [ bless( { 'Kids' => [] }, 'main::HNO' ), bless( { 'Kids' => [ bless( { 'Text' => + 'Eagle Way' }, 'main::C +haracters' ) ] }, 'main::STN' ), bless( { 'Kids' => [ bless( { 'Text' => + 'Gotham City' }, 'main::C +haracters' ) ] }, 'main::MCN' ) ] }, 'main::LOC' ) ];
which producesprint $tmp->[0]->{Kids}->[1]->{Kids}->[0]->{Text}, "\n", $tmp->[0]->{Kids}->[2]->{Kids}->[0]->{Text};
Or in a loop:Eagle Way Gotham City
for ( @{$tmp->[0]->{Kids}} ) { print $_->{Kids}->[0]->{Text}, "\n"; }
|
|---|