in reply to Re^2: How to do atomic file locking?
in thread How to do atomic file locking?

I just realized I never answered your question about what I meant by "graceful".

You ask Perl to get a lock on the file, and off you go. Cleanup is a matter of closing the file.

No funky coding, no oddball exception handling, no having to overthink the problem. Ask it to do its job, and it does -- no muss, no fuss, no thirty lines of code. That, to me, is the epitome of grace.