in reply to Comparing time and date stamps

As long as you stick to the order most-significant to least-significant in your timestamp (as you are already doing), you can just use gt, Perl's normal string greater-than.

print "$file1 is newer than $file2\n" if $file1 gt $file2;

Update: Brainfart time. Replaced cmp with gt