Unlinking (er, I mean deleting) a file can be harder than it looks. In the perl core tests,
1 while unlink $file is often used (to support filesystems that allow multiple versions of a file). This occasionally causes problems when a close() is left out, since at least one platform has the interesting tactic of working around not being able to delete an open file by having unlink() schedule the file for later deletion but return true (causing the
1 while unlink to endlessly loop).
If you are downvoting this for other than lack of interest, thanks for sending me a message or reply to let me know why so I can do better (or just stay quiet) next time.