#!/usr/bin/perl -- use Path::Tiny; use JSON; Main( @ARGV ); exit( 0 ); sub Main { my $in = shift or die "\nUsage: $0 foo.json > foo-tidy.json\n"; binmode STDOUT, ':encoding(UTF-8)'; print JSON->new->utf8(1)->pretty(1)->encode( JSON->new->decode( path( $in )->slurp ) ); }