Your question appears to be about JSON rather than about LWP. Can you write a short script that I can run on my own computer?

Update: I hacked out a lot, but not all extraneous stuff. Why do you need a loop here?

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; # This a sample json data I am getting back in $data my $data = { 'zip' => 'AB3456', 'Tipo' => 'Boat', 'happen' => [ { 'descri' => 'Yellow Bike Tube' } ], 'explanation' => 'Order to go home.', 'notas' => [ { 'corpus' => 'Free Ship:PLAN C', 'To' => 'XQ0000Q', 'ExtraName' => 'Test User', 'sub' => '44 Bokes broken' } ], 'dados' => [ { 'valueA' => '2999', 'Creditd' => '-10', 'collect' => '120.00 usd', 'color' => 'Blue' } ], 'extraname' => 'Mary Lee Jones', 'account' => 'EX500RWX22' }; # This is fine, why is loop needed? # If there where multiple records like this, then there # would be an additional level of indirection and a loop # would be needed to get record specific values of "zip", etc. my $zip = $data->{zip}; my $descri = $data->{happen}[0]->{descri}; my $extra_name = $data->{notas}[0]->{ExtraName}; print "\n $zip - $descri - $extra_name\n"; __END__ Prints: AB3456 - Yellow Bike Tube - Test User

In reply to Re: Parsing data from JSON response file. by Marshall
in thread Parsing data from JSON response file. by Anonymous Monk

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.