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
In reply to Re: Comparing time and date stamps
by FunkyMonk
in thread Comparing time and date stamps
by ewhitt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |