That use of open is only available since 5.8. (See perl58delta.) That may or may not be important to you.
File::Temp can also be helpful if you need the filename or need the file to persist beyond one open/close cycle, but still be cleaned up later. (Both of which are less "safe" depending on how you're using it.)
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re: Safe Temp Files
by xdg
in thread Safe Temp Files
by gmock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |