$file1 = 'C:\baz1.txt'; $file2 = 'C:\bar1.txt'; if (-M $file1 < -M $file2) { print "baz is newer than bar"; } elsif (-M $file1 > -M $file2) { print "bar is newer than baz"; } elsif (-M $file1 == -M $file2) { print "bar and baz are equal"; } else { print "foo, that didn't go well!"; }