use warnings; use strict; use File::Compare; use Text::Diff; use lib "E:\\Program Files (x86)\\Traverse\\lib\\perl"; use lib "C:\\Perl"; my $expect = `expect.expect`; chdir $ARGV[0]; rename "output.new","output.old"; open DIFF, ">alarm.log" or die $!; open OUTPUT, ">output.new" or die $!; print OUTPUT "$expect\n"; if (compare("1.log","2.log") == 0) { print "They're equal\n"; } else { print "They are NOT equal\n"; print DIFF "-------------------------------------------------------------------------------------------------------------------\n"; print DIFF "The script has identified the following changes:\n\n"; my $diff = diff "output.new", "output.old", { STYLE => "Unified" , OUTPUT => \*DIFF }; print DIFF "-------------------------------------------------------------------------------------------------------------------\n\n"; close(DIFF); }