in reply to How to read CPAN documentation
How does it not help much? I mean this as a sincere question, not to sound harsh or critisizing. I'm just wondering which part is causing you troubles.
The synopsis pretty much gives you what you need, only you need to fill in the blanks. And there are plenty of blanks, which the module's documentation authour couldn't know. For example, what are you trying to do? Do you need to read JSON data and have it converted to a native Perl data structure? Or do you have a Perl data structure which you need serialized into JSON? Whatever the case, the following blanks to be filled in is: what will the source data look like? How will you obtain it? Is the source data in exactly the same format as you want your output to be, or do you need to switch around bits and pieces? Which? How? Why?
All of these questions are out of scope for the JSON docs.
For example, do you want to read in the ID3 tags of all MP3 files in a given directory, and store all metadata for all songs in one big JSON file? You can do that, but you will have to figure out how to pull the ID3 tags from the MP3s and in which structure you want to store everything.
Are you querying a webservice, which will respond with a one megabyte long string of JSON data, of which you need to extract one specific element, but where there is a complicated set of logical rules to determine where that element lives inside the structure? The JSON will make that a lot easier for you, by giving you one function call to convert the JSON to a data structure that's convenient to work with in the Perl language. But determining which element you want to get, and actually getting it? That's still up to you.
So, I ask again, what part is it that you don't understand?
|Replies are listed 'Best First'.|
Re^2: How to read CPAN documentation
by perl.j (Pilgrim) on Jul 06, 2012 at 12:12 UTC