Skip to content

Instantly share code, notes, and snippets.

@bessarabov
Created December 5, 2015 21:14
Show Gist options
  • Save bessarabov/8300b6d8497071f04de9 to your computer and use it in GitHub Desktop.
Save bessarabov/8300b6d8497071f04de9 to your computer and use it in GitHub Desktop.
#!/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 Data::Comparator qw(data_comparator);
use File::Slurp;
use JSON::PP;
# global vars
# subs
# main
sub main {
my $one = read_file('one.json');
my $two = read_file('two.json');
$one = decode_json $one;
$two = decode_json $two;
my $diff = data_comparator($one, $two);
if ($diff->is_empty()) {
say '$a and $b are alike';
} else {
say '$a and $b are not alike';
}
say '#END';
}
main();
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment