#!/usr/bin/perl # json-pretty: Take a JSON file and pretty-print it. # # Usage: json-pretty # # --Kirsle use strict; use warnings; use JSON; my $file = shift(@ARGV) or die "Usage: $0 \n"; my $json = JSON->new->utf8->pretty(); local $/ = undef; open(my $fh, "<", $file); my $text = <$fh>; close($fh); my $data = $json->decode($text); print $json->encode($data);