in reply to Open Has a New Trick
Another nifty feature in 5.8.0 to do with the open function and temporary files is the creation of anonymous file handles. For example:
open( $fh, '+>', undef ) || die $!;
Where the undefined value is a literal undef statement, rather than an undefined variable. This syntax will open a file handle and where permitted by the file system, unlink the file while holding it open. The result is an anonymous STDIO stream which will be lost when the file handle is closed.
Note too that this anonymous file handle functionality is also available through the File::Temp module which has been incorporated into the core 5.8.0 distribution.
perl -e 'print+unpack("N",pack("B32","00000000000000000000000111000110")),"\n"'
|
---|