$fh = tmpfile();
($fh, $file) = tmpnam();
- ($fh, $file) = tmpfile();
+ $fh = tmpfile();
Compatibility functions:
if ( $open_success ) {
# Reset umask
- umask($umask);
+ umask($umask) if defined $umask;
# Opened successfully - return file handle and name
return ($fh, $path);
} else {
# Reset umask
- umask($umask);
+ umask($umask) if defined $umask;
# Error opening file - abort with error
# if the reason was anything but EEXIST
if (mkdir( $path, 0700)) {
# created okay
# Reset umask
- umask($umask);
+ umask($umask) if defined $umask;
return undef, $path;
} else {
# Reset umask
- umask($umask);
+ umask($umask) if defined $umask;
# Abort with error if the reason for failure was anything
# except EEXIST
=item B<tmpfile>
-In scalar context, returns the filehandle of a temporary file.
+Returns the filehandle of a temporary file.
$fh = tmpfile();