String::Diff

Simple diff to String
Download

String::Diff Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Kazuhiro Osawa
  • Publisher web site:
  • http://search.cpan.org/~yappo/

String::Diff Tags


String::Diff Description

String::Diff is the difference of a consecutive string is made. After general diff is done, the difference in the line is searchable.SYNOPSIS use String::Diff; use String::Diff qw( diff_fully diff diff_merge diff_regexp );# export functions # simple diff my($old, $new) = String::Diff::diff('this is Perl', 'this is Ruby'); print "$old\n";# this is print "$new\n";# this is {Ruby} my $diff = String::Diff::diff('this is Perl', 'this is Ruby'); print "$diff->\n";# this is print "$diff->\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->\n";# this is Perl print "$diff->\n";# this is Ruby # merged my $diff = String::Diff::diff_merge('this is Perl', 'this is Ruby'); print "$diff\n";# this is {Ruby} my $diff = String::Diff::diff_merge('this is Perl', 'this is Ruby', remove_open => '', remove_close => '', append_open => '', append_close => '', ); print "$diff\n";# this is PerlRuby # change to default marks %String::Diff::DEFAULT_MARKS = ( remove_open => '', remove_close => '', append_open => '', append_close => '', separator => '', # for diff_merge ); # generated for regexp my $diff = String::Diff::diff_regexp('this is Perl', 'this is Ruby'); print "$diff\n";# this\ is\ (?:Perl|Ruby) # detailed list my $diff = String::Diff::diff_fully('this is Perl', 'this is Ruby'); for my $line (@{ $diff-> }) { print "$line->: '$line->'\n"; } # u: 'this is ' # -: 'Perl' for my $line (@{ $diff-> }) { print "$line->: '$line->'\n"; } # u: 'this is ' # +: 'Ruby'Product's homepage


String::Diff Related Software