Usually on the web, the If-modified-since solution (used behind the scenes by LWP::Simple::mirror) is the preferred solution. However, if that solution is not reliable (and therefore not reliable for others either), you will probably need to fetch the file and compare them. You could probably start your search here on cpan if you want to use a Perl solution. If you don't limit yourself to Perl, there are other OS-specific tools that you can use (like diff or rdist).
On the other hand, if all you are looking to do is see if the file needs to be updated locally, and you have to retrieve the file to determine that anyway, why not just update the file.
As an alternative, is there a checksum (MD5, etc) file generated for the file on the remote server? If so, you could retrieve that instead (in theory it should be smaller), and compare them to determine if you need to download the real file.
I would also see if you can work with the source site to get their timestamps correct for the mirror process to work. That is the RightWay™ to do it. If this does not work, then any cache (your workstation's local cache, company, isp, accelerators on the remote side, etc) in the way can hose your checks anyway.
| [reply] [d/l] [select] |