First, a quick note about formatting your posts: put "<code>" and "</code>" at the beginning and end of perl code -- not including paragraphs of text (use plain old html tags like <P>, <UL>, etc to format your text). It's easy to get to Writeup Formatting Tips -- take a look at that.
Second, how about you try one more diagnostic: create a junk file (or locate such a file that already exists), and give the path/name of that file as a command line arg to this little script:
If the outputs disagree with the comments, you might have a deep problem -- you may need to report which OS you're using, and which perl version. (Maybe even what sort of hardware you have.)
print "-M of $ARGV is ".(-M $ARGV).$/; # should be positive
system("touch $ARGV"); # reset file's mod time to now.
print "-M of $ARGV is now ".(-M $ARGV).$/; # should be (very sma
print "-M of $ARGV is now ".(-M $ARGV).$/; # should be equal to
You seem to be doing the right sort of test (-M>0), so it could still be one of those cases where you really believe that you're checking the right file (the same one that the 3rd party thing created), and that the file is new, etc, when in fact...
update: fixed link