use strict; use warnings; use File::Compare; use String::Compare; # tmp.pl and tmp.pl.other are copies of the same file print File::Compare::compare("tmp.pl", "tmp.pl.other"). "\n"; print String::Compare::compare("foo", "boo"). "\n"; output: 1 0.6