Skip to content

Instantly share code, notes, and snippets.

@jlav1n
Created August 22, 2016 21:47
Show Gist options
  • Save jlav1n/78751834e71291103d7d39bdd1bb48bc to your computer and use it in GitHub Desktop.
Save jlav1n/78751834e71291103d7d39bdd1bb48bc to your computer and use it in GitHub Desktop.
#!/bin/env perl
use strict;
use warnings;
use JSON::MaybeXS qw(decode_json);
chomp( my $input = <STDIN> );
my $ref = decode_json( $input );
my $json = JSON::MaybeXS->new;
print $json->pretty(1)->canonical(1)->encode( $ref ) . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment