use constant MTIME => 9; # File modification time if ((stat("$BulletinSrc"))[MTIME] > (stat("$BulletinPDF"))[MTIME]) { $Text .= " PDF is stale \"$BulletinPDF\"\n"; $Errors++; } else { $Text .= " PDF is UP-TO-DATE \"$BulletinPDF\"\n"; } #### if (-M "$BulletinSrc" < -M "$BulletinPDF") { $Text .= " PDF is stale \"$BulletinPDF\"\n"; $Errors++; } else { $Text .= " PDF is UP-TO-DATE \"$BulletinPDF\"\n"; } #### Start of program TDS : : : V V |<----- A ----->| |---------------: : TDS : : : V : |-----------: |<--- B --->| length(A) < length(B) means A is stale date(A) > date(B) means A is stale (notice start of program is irrelevant!) i.e., stat() returns a TDS (time date stamp) -M returns a length since the start of the program