in reply to Re^3: self detecting script
in thread self detecting script

Yes. If you actually flock the file, that lock will go away when the perl process exits, though the file itself will not.