General advice. Try Devel::REPL. You can take a step by step approach to get the correct statement to access data in a deeply nested datastructure. If you use Devel::REPL, make sure you also load the plugins (easiest is to set them in the default config).
cat $HOME/.re.pl/repl.rc $_REPL->load_plugin($_) for qw(History LexEnv MultiLine::PPI DDS);
# execute the Devel::REPL and paste Dumper output. re.pl $ my $ my $VAR1 = [ 'ResultSet', [ { 'xmlns' => 'urn:yahoo:maps', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation' => 'urn:yahoo:maps http://api.local.yahoo.com /M +apsService/V1/GeocodeResponse.xsd' }, 'Result', [ { 'precision' => 'address' }, 'Latitude', {}, 0, '28.312216' , 'Longitude', {}, 0, '-81.380514' , 'Address', {}, 0, '2335 Pepper Tree Ct' , 'City', {}, 0, 'Kissimmee' , 'State', {}, 0, 'FL' , 'Zip', {}, 0, '34744-2820' , 'Country', {}, 0, 'US' ] ] ]; $ARRAY1 = [ 'ResultSet', [ { xmlns => 'urn:yahoo:maps', "xmlns:xsi" => 'http://www.w3.org/2001/XMLSchema-inst +ance', "xsi:schemaLocation" => 'urn:yahoo:maps http://api.local.yahoo +.com /MapsService/V1/GeocodeResponse.xsd' }, 'Result', [ { precision => 'address' }, 'Latitude', {}, 0, 28.312216, 'Longitude', {}, 0, -81.380514, 'Address', {}, 0, '2335 Pepper Tree Ct', 'City', {}, 0, 'Kissimmee', 'State', {}, 0, 'FL', 'Zip', {}, 0, '34744-2820', 'Country', {}, 0, 'US' ] ] ]; # now try to narrow down the correct path $ $VAR1->[1] $ARRAY1 = [ { xmlns => 'urn:yahoo:maps', "xmlns:xsi" => 'http://www.w3.org/2001/XMLSchema-instan +ce', "xsi:schemaLocation" => 'urn:yahoo:maps http://api.local.yahoo.c +om /MapsService/V1/GeocodeResponse }, 'Result', [ { precision => 'address' }, 'Latitude', {}, 0, 28.312216, 'Longitude', {}, 0, -81.380514, 'Address', {}, 0, '2335 Pepper Tree Ct', 'City', {}, 0, 'Kissimmee', 'State', {}, 0, 'FL', 'Zip', {}, 0, '34744-2820', 'Country', {}, 0, 'US' ] ]; # oops wrong way $ $VAR1->[1][3] # aah closer $ $VAR1->[1][2] $ARRAY1 = [ { precision => 'address' }, 'Latitude', {}, 0, 28.312216, 'Longitude', {}, 0, -81.380514, 'Address', {}, 0, '2335 Pepper Tree Ct', 'City', {}, 0, 'Kissimmee', 'State', {}, 0, 'FL', 'Zip', {}, 0, '34744-2820', 'Country', {}, 0, 'US' ]; # got the Latitude $ $VAR1->[1][2][4] 28.312216

print+qq(\L@{[ref\&@]}@{['@'x7^'!#2/"!4']});

In reply to Re: XML::Parser reader by codeacrobat
in thread XML::Parser reader by nevafuse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.