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

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

Expand Messages
  • Randall R Schulz
    ... I ll give that a try. ... Definitely not. It s JSON. ... Randall Schulz
    Message 1 of 10 , Dec 3, 2007
      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.

      Definitely not. It's JSON.


      > good luck


      Randall Schulz
    • Randall R Schulz
      ... 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
      Message 2 of 10 , Dec 3, 2007
        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
      Your message has been successfully submitted and would be delivered to recipients shortly.