I just spotted Nuba Princigalli's tweet on pretty colorful JSON. Neat!
My first thought was that Perl could do the download without curl
perl -MLWP::Simple -MDDP -MJSON -e 'p decode_json get shift' http://www.reddit.com/r/perl.json
My next thought was that Mojolicious could do the whole thing
perl -Mojo -E 'say r j g(shift)->body' http://www.reddit.com/r/perl.json
The g does the HTTP GET, the j decodes the JSON, and the r dumps it out. But it uses Data::Dumper. How to get it to use Data::Printer instead? I guess we could just use Data::Printer directly
perl -Mojo -MDDP=alias,dump,output,stdout -e 'dump j g(shift)->body' http://www.reddit.com/r/perl.json
Both Mojo and DDP are defining a p, so I'm asking DDP to use dump instead. And DDP uses stderr by default, so I'm asking it to use sdtout instead.
Hrm. Not very satisfying. I feel like I'm fighting both modules. Is there a Data::Printer plugin for Mojolicious that I'm not aware of?