Skip to content

Instantly share code, notes, and snippets.

@bessarabov
Created December 5, 2015 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bessarabov/2c4057b55276cb267c9c to your computer and use it in GitHub Desktop.
Save bessarabov/2c4057b55276cb267c9c 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 String::Diff;
use File::Slurp;
use Term::ANSIColor;
# global vars
# subs
# main
sub main {
my $one = read_file('one.json');
my $two = read_file('two.json');
say String::Diff::diff_merge(
$one,
$two,
remove_open => Term::ANSIColor::RED(),
remove_close => Term::ANSIColor::RESET(),
append_open => Term::ANSIColor::GREEN(),
append_close => Term::ANSIColor::RESET(),
);
}
main();
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment