Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Diff colorizer
#!/usr/bin/perl -n
use Term::ANSIColor;
print colored( $_, 'red' ) and next if /^</;
print colored( $_, 'green' ) and next if /^>/;
print colored( $_, 'bold blue' ) and next if /^[\d,]+[acd][\d,]+$/;
print;
=head1 NAME
Diff Colorizer
=head1 DESCRIPTION
Colorize output of diff: left parts becomes red, right ones becomes green and line numbers becomes bold blue
=head1 AUTHOR
Alexander Sapozhnikov
L<< http://shoorick.ru/ >>
L<< E<lt>shoorick@cpan.orgE<gt> >>
=cut
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.