Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: json data: dereferencing arrays

by sundialsvc4 (Abbot)
on May 14, 2013 at 13:31 UTC ( #1033458=note: print w/ replies, xml ) Need Help??


in reply to json data: dereferencing arrays

As an aside, in situations such as this one I like to use “data walkers” whenever possible ... search for the keyword walker at http://search.cpan.org and you will see what I mean.   (Say, Data::Leaf::Walker ... there are 110 packages today to choose from.)   This lets me “let the Walker do the walking” through the now-arbitrary data structure that I have been given, and to call my subroutines only for the elements of interest to me no matter where exactly they happen to be.   If the data structure changes, my code still works.   Some of these are simple; others more-or-less emulate the approach of “XPath expressions” in XML.   While this notion is certainly not of a nature that “you should always do this” – not by any means – it is a useful technique to keep in the back of your pocket-protector.

I used this technique very successfully to winnow through parse-trees that were produced from a nasty collection of SAS® programs, Korn shell scripts, and Tivoli® workload schedules.   Truly an ugly project to design and build, but it worked splendidly, thanks in very large part to this technique.


Comment on Re: json data: dereferencing arrays

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (20)
As of 2014-10-30 14:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls