in reply to bad results from stat()

Size and mtime are the 8th and 10th items returned by stat. Try ($size,$mtime) = (stat($filename))[7,9]; See perldoc -f stat or perldoc perlcheat