Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: JSON parsing issue please help

by BrowserUk (Pope)
on Sep 29, 2012 at 18:14 UTC ( #996410=note: print w/ replies, xml ) Need Help??


in reply to JSON parsing issue please help

It is usual to state what problem you are having, or how the results of your code differ from your expectations.

However, looking at your code, I see you are trying to iterate the array held in the first element of the entryArray array:

@{ $json_text->{balArray}[0]{containerArray}[0]{entryArray}[0] } ...........................................................^^^

But looking at the json, the elements of the entryArray array, do not contain arrays, they contain hashes.

If you were using strict and warnings, you'd be getting a "Not an ARRAY reference at .." message pointing at the above line, which would be a strong clue to the solution of your problem.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong

/font


Comment on Re: JSON parsing issue please help
Select or Download Code
Re^2: JSON parsing issue please help
by Anonymous Monk on Sep 30, 2012 at 06:20 UTC

    If you were using strict and warnings, you'd be getting a "Not an ARRAY reference at .." message pointing at the above line, which would be a strong clue to the solution of your problem.

    neither strict nor warnings are required

    $ perl -e " $f = { }; $f->[0]; " Not an ARRAY reference at -e line 1.

      Good point.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

      RIP Neil Armstrong

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996410]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2014-09-22 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (178 votes), past polls