<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: Parsing JSON In Perl By Example &#8211; SouthParkStudios.com South Park Episodes</title> <atom:link href="http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/feed/" rel="self" type="application/rss+xml" /><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/</link> <description>where things have nothing to do with beer - tutorials, tips, how-tos, thoughts, hacks, and other techy nonsense</description> <lastBuildDate>Sat, 11 Feb 2012 17:00:25 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>By: Aneesh Karve</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-52347</link> <dc:creator>Aneesh Karve</dc:creator> <pubDate>Thu, 12 Jan 2012 23:45:55 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-52347</guid> <description>thank you for the clear example.
for general coding practices in the wild, it&#039;s safer to bypass the JSON object&#039;s integrity checks one-by-one, if and only if needed (i.e. allow_nonref, relaxed, escape_slash, loose, allow_singlequote, allow_barekey).
if programmers use all of these bypass flags by default, they&#039;re missing out on the improved performance of JSON::XS, as well as missing out on data integrity checks.</description> <content:encoded><![CDATA[<p>thank you for the clear example.</p><p>for general coding practices in the wild, it&#039;s safer to bypass the JSON object&#039;s integrity checks one-by-one, if and only if needed (i.e. allow_nonref, relaxed, escape_slash, loose, allow_singlequote, allow_barekey).</p><p>if programmers use all of these bypass flags by default, they&#039;re missing out on the improved performance of JSON::XS, as well as missing out on data integrity checks.</p> ]]></content:encoded> </item> <item><title>By: henq</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-52328</link> <dc:creator>henq</dc:creator> <pubDate>Sun, 01 Jan 2012 16:22:54 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-52328</guid> <description>Or, for simple JSON of clean source, consider using an eval:
my $res = $response-&gt;content;
$res  =~ s/:/ =&gt;/g;  #replace semicolon by perl&#039;s assign operator
$res  =~ s/null/0/g;  #or &#039;&#039; , depending on usage
my @mydata = eval {$res};    # if you know it is an array
print $@ if ($@);
print $mydata[0] ;  # first element</description> <content:encoded><![CDATA[<p>Or, for simple JSON of clean source, consider using an eval:</p><p> my $res = $response-&gt;content;<br
/> $res  =~ s/:/ =&gt;/g;  #replace semicolon by perl&#039;s assign operator<br
/> $res  =~ s/null/0/g;  #or &#034; , depending on usage</p><p> my @mydata = eval {$res};    # if you know it is an array<br
/> print $@ if ($@);</p><p> print $mydata[0] ;  # first element</p> ]]></content:encoded> </item> <item><title>By: Artem Russakovskii</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-52291</link> <dc:creator>Artem Russakovskii</dc:creator> <pubDate>Mon, 12 Dec 2011 16:26:29 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-52291</guid> <description>I was wondering the same thing until I realized that JSON doesn&#039;t have parameters like XML does which makes its parsing, consumption, and direct translation into data structures very easy and straightforward. It&#039;s also a lot more compact, though harder to read if unformatted. JSON parsers seem to be simpler, more, agile, and less buggy as they don&#039;t have to be as complex.</description> <content:encoded><![CDATA[<p>I was wondering the same thing until I realized that JSON doesn&#039;t have parameters like XML does which makes its parsing, consumption, and direct translation into data structures very easy and straightforward. It&#039;s also a lot more compact, though harder to read if unformatted. JSON parsers seem to be simpler, more, agile, and less buggy as they don&#039;t have to be as complex.</p> ]]></content:encoded> </item> <item><title>By: spydox</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-52290</link> <dc:creator>spydox</dc:creator> <pubDate>Mon, 12 Dec 2011 16:13:31 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-52290</guid> <description>(unlike some others) I appreciate your effort to publish this. We&#039;re just getting started with JSON so it was a useful Primer.
Sometimes I do wonder why we *invent another way* do so something - XML pretty much handles NV pairs. But I&#039;m trying to keep an open mind, and optimistic that JSON will be a great tool for us.
Our goal is primarily parsing arbitrary order form data, then applying logic and rules, we interpret the data to populate thousands of Oracle fields.
I&#039;m not really sure which of those parts JSON helps us with- perhaps as a object we can pass of to an SQL generator? That&#039;s really not a difficult role, but I&#039;m hoping it standardizes that step.</description> <content:encoded><![CDATA[<p>(unlike some others) I appreciate your effort to publish this. We&#039;re just getting started with JSON so it was a useful Primer.</p><p>Sometimes I do wonder why we *invent another way* do so something &#8211; XML pretty much handles NV pairs. But I&#039;m trying to keep an open mind, and optimistic that JSON will be a great tool for us.</p><p>Our goal is primarily parsing arbitrary order form data, then applying logic and rules, we interpret the data to populate thousands of Oracle fields.</p><p>I&#039;m not really sure which of those parts JSON helps us with- perhaps as a object we can pass of to an SQL generator? That&#039;s really not a difficult role, but I&#039;m hoping it standardizes that step.</p> ]]></content:encoded> </item> <item><title>By: Paul Maddox</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-51665</link> <dc:creator>Paul Maddox</dc:creator> <pubDate>Sat, 04 Jun 2011 09:37:25 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-51665</guid> <description>Very useful.  Thanks.</description> <content:encoded><![CDATA[<p>Very useful.  Thanks.</p> ]]></content:encoded> </item> <item><title>By: Goutham Raja</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-51575</link> <dc:creator>Goutham Raja</dc:creator> <pubDate>Thu, 05 May 2011 12:10:32 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-51575</guid> <description>You done a great job... Thanks a lot...</description> <content:encoded><![CDATA[<p>You done a great job&#8230; Thanks a lot&#8230;</p> ]]></content:encoded> </item> <item><title>By: Wes Garrison</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-51386</link> <dc:creator>Wes Garrison</dc:creator> <pubDate>Wed, 16 Feb 2011 20:43:22 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-51386</guid> <description>This was fantastic, thanks a bunch!
I used LWP::UserAgent to POST the request, but the JSON library worked great, and your example made it easy to understand how the parsed data was structured ie. hash -&gt; array -&gt; hash, etc.
-Wes</description> <content:encoded><![CDATA[<p>This was fantastic, thanks a bunch!</p><p>I used LWP::UserAgent to POST the request, but the JSON library worked great, and your example made it easy to understand how the parsed data was structured ie. hash -&gt; array -&gt; hash, etc.</p><p>-Wes</p> ]]></content:encoded> </item> <item><title>By: BartJ</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-39251</link> <dc:creator>BartJ</dc:creator> <pubDate>Tue, 08 Jun 2010 11:49:49 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-39251</guid> <description>this is so not true...Read this answer on StackOverflow to find out why - http://stackoverflow.com/questions/408570/regular-expression-to-parse-an-array-of-json-objects/408641#408641
Excerpt from the answer: &quot;Balanced parentheses are literally a textbook example of a language that cannot be processed with regular expressions. JSON is essentially balanced parentheses plus a bunch of other stuff, with the braces replaced by parens. In the hierarchy of formal languages, JSON is a context-free language. Regular expressions can&#039;t parse context-free languages.&quot;</description> <content:encoded><![CDATA[<p>this is so not true&#8230;Read this answer on StackOverflow to find out why &#8211; <a
href="http://stackoverflow.com/questions/408570/regular-expression-to-parse-an-array-of-json-objects/408641#408641" rel="nofollow">http://stackoverflow.com/questions/408570/regular-expression-to-parse-an-array-of-json-objects/408641#408641</a><br
/> Excerpt from the answer: &#034;Balanced parentheses are literally a textbook example of a language that cannot be processed with regular expressions. JSON is essentially balanced parentheses plus a bunch of other stuff, with the braces replaced by parens. In the hierarchy of formal languages, JSON is a context-free language. Regular expressions can&#039;t parse context-free languages.&#034;</p> ]]></content:encoded> </item> <item><title>By: mangoo</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-38654</link> <dc:creator>mangoo</dc:creator> <pubDate>Thu, 03 Jun 2010 10:31:11 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-38654</guid> <description>Looks like I missed &quot;-support_by_pp;&quot; ;) - working now, thanks.</description> <content:encoded><![CDATA[<p>Looks like I missed &#034;-support_by_pp;&#034; <img
src='http://beerpla.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> &#8211; working now, thanks.</p> ]]></content:encoded> </item> <item><title>By: mangoo</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-38653</link> <dc:creator>mangoo</dc:creator> <pubDate>Thu, 03 Jun 2010 10:29:20 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-38653</guid> <description>Hmm, doesn&#039;t seem to be working for me:
Getting json http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1
escape_slash is not supported in JSON::XS. at json.pl line 25
loose is not supported in JSON::XS. at json.pl line 25
allow_singlequote is not supported in JSON::XS. at json.pl line 25
allow_barekey is not supported in JSON::XS. at json.pl line 25
[[JSON ERROR]] JSON parser crashed! malformed JSON string, neither array, object, number, string or atom, at character offset 0 [&quot;/* Generated locally...&quot;] at json.pl line 25.</description> <content:encoded><![CDATA[<p>Hmm, doesn&#039;t seem to be working for me:<br
/> Getting json <a
href="http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1" rel="nofollow">http://www.southparkstudios.com/includes/utils/proxy_feed.php?html=season_json.jhtml%3fseason=1</a><br
/> escape_slash is not supported in JSON::XS. at json.pl line 25<br
/> loose is not supported in JSON::XS. at json.pl line 25<br
/> allow_singlequote is not supported in JSON::XS. at json.pl line 25<br
/> allow_barekey is not supported in JSON::XS. at json.pl line 25<br
/> [[JSON ERROR]] JSON parser crashed! malformed JSON string, neither array, object, number, string or atom, at character offset 0 ["/* Generated locally..."] at json.pl line 25.</p> ]]></content:encoded> </item> <item><title>By: Parviz</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-35908</link> <dc:creator>Parviz</dc:creator> <pubDate>Tue, 27 Apr 2010 01:07:14 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-35908</guid> <description>great! I tried it and it worked. Thanks for sharing this.</description> <content:encoded><![CDATA[<p>great! I tried it and it worked. Thanks for sharing this.</p> ]]></content:encoded> </item> <item><title>By: Ventrilo Servers</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-29113</link> <dc:creator>Ventrilo Servers</dc:creator> <pubDate>Wed, 23 Dec 2009 23:12:44 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-29113</guid> <description>This is extremely useful!  Thank you.  South Park is awesome also so it&#039;s a great example. =)</description> <content:encoded><![CDATA[<p>This is extremely useful!  Thank you.  South Park is awesome also so it&#039;s a great example. =)</p> ]]></content:encoded> </item> <item><title>By: South Park</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-28084</link> <dc:creator>South Park</dc:creator> <pubDate>Sat, 05 Dec 2009 00:16:33 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-28084</guid> <description>Finally got the hang of this, works a treat thank you so much artem!</description> <content:encoded><![CDATA[<p>Finally got the hang of this, works a treat thank you so much artem!</p> ]]></content:encoded> </item> <item><title>By: an essay</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-28054</link> <dc:creator>an essay</dc:creator> <pubDate>Fri, 04 Dec 2009 09:56:55 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-28054</guid> <description>Hey its a marvelous post. Wish You sucess.</description> <content:encoded><![CDATA[<p>Hey its a marvelous post. Wish You sucess.</p> ]]></content:encoded> </item> <item><title>By: South Park</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-27903</link> <dc:creator>South Park</dc:creator> <pubDate>Tue, 01 Dec 2009 01:15:03 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-27903</guid> <description>This was really useful to me. I&#039;m still new to JSON though so i guess it&#039;ll take some getting used to. Thanks though buddy!
P.S Also a massive fan of south park, props! ;)</description> <content:encoded><![CDATA[<p>This was really useful to me. I&#039;m still new to JSON though so i guess it&#039;ll take some getting used to. Thanks though buddy!</p><p>P.S Also a massive fan of south park, props! <img
src='http://beerpla.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p> ]]></content:encoded> </item> <item><title>By: Farhan</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-20630</link> <dc:creator>Farhan</dc:creator> <pubDate>Mon, 13 Jul 2009 03:00:43 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-20630</guid> <description>Hi there,
I appreciate the concise example you&#039;ve provided. I was looking for a way to get something done in JSON quickly, and this looks like the ticket.
Thanks so much, and keep it up.
Farhan</description> <content:encoded><![CDATA[<p>Hi there,</p><p>I appreciate the concise example you&#039;ve provided. I was looking for a way to get something done in JSON quickly, and this looks like the ticket.</p><p>Thanks so much, and keep it up.</p><p>Farhan</p> ]]></content:encoded> </item> <item><title>By: Artem Russakovskii</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-18401</link> <dc:creator>Artem Russakovskii</dc:creator> <pubDate>Sun, 24 May 2009 06:21:16 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-18401</guid> <description>@dilino
Well, if we want to get technical, then you need all these: http://deps.cpantesters.org/?module=WWW::Mechanize;perl=latest but they should be installed automatically when you install WWW::Mechanize.
@jnlawton
Indeed, you&#039;re right, it wasn&#039;t a very complicated example (though &#039;episode&#039; is actually an array, isn&#039;t it?). The purpose was to introduce the usage of the JSON module.</description> <content:encoded><![CDATA[<p>@dilino<br
/> Well, if we want to get technical, then you need all these: <a
href="http://deps.cpantesters.org/?module=WWW::Mechanize;perl=latest" rel="nofollow">http://deps.cpantesters.org/?module=WWW::Mechanize;perl=latest</a> but they should be installed automatically when you install WWW::Mechanize.</p><p>@jnlawton<br
/> Indeed, you&#039;re right, it wasn&#039;t a very complicated example (though &#039;episode&#039; is actually an array, isn&#039;t it?). The purpose was to introduce the usage of the JSON module.</p> ]]></content:encoded> </item> <item><title>By: dilino</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-18400</link> <dc:creator>dilino</dc:creator> <pubDate>Sun, 24 May 2009 05:55:24 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-18400</guid> <description>Great article, thanks! I also needed HTTP/Response/Encoding.pm from http://search.cpan.org/~dankogai/HTTP-Response-Encoding-0.05/lib/HTTP/Response/Encoding.pm .</description> <content:encoded><![CDATA[<p>Great article, thanks! I also needed HTTP/Response/Encoding.pm from <a
href="http://search.cpan.org/~dankogai/HTTP-Response-Encoding-0.05/lib/HTTP/Response/Encoding.pm" rel="nofollow">http://search.cpan.org/~dankogai/HTTP-Response-Encoding-0.05/lib/HTTP/Response/Encoding.pm</a> .</p> ]]></content:encoded> </item> <item><title>By: The Invisible War &#187; Eninvent</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-13742</link> <dc:creator>The Invisible War &#187; Eninvent</dc:creator> <pubDate>Wed, 25 Feb 2009 17:01:16 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-13742</guid> <description>[...] For those inclined, here&#8217;s the perl script I used to query the API. It borrows heavily from this example. [...]</description> <content:encoded><![CDATA[<p>[...] For those inclined, here&#039;s the perl script I used to query the API. It borrows heavily from this example. [...]</p> ]]></content:encoded> </item> <item><title>By: jnlawton</title><link>http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-5280</link> <dc:creator>jnlawton</dc:creator> <pubDate>Wed, 09 Jul 2008 04:23:59 +0000</pubDate> <guid
isPermaLink="false">http://beerpla.net/2008/03/27/parsing-json-in-perl-by-example-southparkstudioscom-south-park-episodes/#comment-5280</guid> <description>With all due respect, this is a trivial example. The JSON structure didn&#039;t have any embedded objects or even an array. Did you even need a JSON parser for this? Nope... RegExp&#039;s would have been fine.
jl</description> <content:encoded><![CDATA[<p>With all due respect, this is a trivial example. The JSON structure didn&#039;t have any embedded objects or even an array. Did you even need a JSON parser for this? Nope&#8230; RegExp&#039;s would have been fine.</p><p>jl</p> ]]></content:encoded> </item> </channel> </rss>
