in reply to comparing files based on timestamps

perldoc -f stat

could be what you are searching for.