Loading ...
Sorry, an error occurred while loading the content.

21736Re: [ydn-javascript] Re: Any JSON Pretty-Printers Out There?

Expand Messages
  • Randall R Schulz
    Dec 3, 2007
    • 0 Attachment
      On Monday 03 December 2007 07:34, Randall R Schulz wrote:
      > On Monday 03 December 2007 02:52, freyfogle wrote:
      > > this can be greatly simplified, but for clarity I've been fairly
      > > verbose:
      > >
      > > ...
      >
      > I'll give that a try.
      >
      > > From your error message though it looks like you have html not
      > > json.

      Gack. That was complete cockpit error. I tried to manually install the
      necessary Perl packages. Then I remembered CPAN was a command that
      handled all the server interaction, dependencies and building. The
      reason for all the HTML fragments in the diagnostics I was getting was
      that one of the files I manually retrieved from the CPAN package index
      page was named with a .pm suffix, but was actually an HTML file (the
      information page for that package).


      I'm on the right track now, but Ask's simple command line:

      perl -I$HOME/.cpan/build/JSON-1.15/lib -MJSON -e \
      '$j=JSON->new(pretty=>1); $/=undef;
      print $j->objToJson($j->jsonToObj(<>))'

      Just outputs a large number (135862740). It doesn't seem to matter what
      JSON input I supply...


      However, with only a tiny bit of tweaking (to make it a pure filter, at
      least for now), your script works fine.


      Thanks!


      Randall Schulz
    • Show all 10 messages in this topic