Last active
December 5, 2015 21:41
-
-
Save bessarabov/cd739f6aed904fa53c88 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
=encoding UTF-8 | |
=cut | |
=head1 DESCRIPTION | |
=cut | |
# common modules | |
use strict; | |
use warnings FATAL => 'all'; | |
use feature 'say'; | |
use utf8; | |
use open qw(:std :utf8); | |
use DDP; | |
use Carp; | |
use JSON::MergePatch; | |
use File::Slurp; | |
use JSON::PP; | |
# global vars | |
# subs | |
# main | |
sub main { | |
my $one = read_file('one.json'); | |
my $two = read_file('two.json'); | |
my $diff = json_merge_diff($one, $two); | |
my $json_coder = JSON::PP | |
->new | |
->pretty | |
->canonical | |
->indent_length(4) | |
; | |
my $pretty_json = $json_coder->encode($diff); | |
say $pretty_json; | |
} | |
main(); | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment