packagechecker::commondiff;useutf8;usestrict;usewarnings;useText::WordDiff;# the next line can be deleted useprivate::ANSIColor;# just using private color scheme for Text::WordDiff::ANSIColorsubnew{bless{},shift};subautomata{my$self=shift;return0;};subcheck{my$self=shift;my$title=shift;my$old=shift;my$new=shift;my$summary=shift;my$diff=word_diff(\$old,\$new,{STYLE=>'ANSIColor'});# $diff.=join(',',map {ord($_)} @{[split(//,$old)]}[0..3,-3,-2,-1])."\n";# $diff.=join(',',map {ord($_)} @{[split(//,$new)]}[0..3,-3,-2,-1])."\n";$diff.=length($old).'->'.length($new)."\n";$diff.="\n".$summary."\n";print$diff;local$|=1;if($oldeq$new){print"$title did not change. Press ENTER to continue without changing anything!";my$ok=<STDIN>;return0;}else{print"$title OK?";my$ok=<STDIN>;return$ok;};};1;