I created String::Diff.
String::Diff is line diff tool, very simple.
# simple diff my $diff = String::Diff::diff('this is Perl', 'this is Ruby'); print "$diff->[0]\n";# this is [Perl] print "$diff->[1]\n";# this is {Ruby}
my $diff = String::Diff::diff('this is Perl', 'this is Ruby',{ remove_open => '', remove_close => '', append_open => '', append_close => '', }); print "$diff->[0]\n";# this isPerlprint "$diff->[1]\n";# this is Ruby
Re: Ooops!
jjore on 2006-11-21T18:05:20
I misunderstood. Whoops. Here's how I'd use this: with Term::ANSIColor.
use Term::ANSIColor 'color';
my $diff = String::Diff::diff('this is Perl', 'this is Ruby',{
remove_open => color( 'bold red' ),
remove_close => color( 'reset' ),
append_open => color( 'bold green' ),
append_close => color( 'reset' ),
});