1 package # Hide from PAUSE
17 use File::Temp qw( tempfile tempdir );
18 use Fcntl qw( :flock );
20 my $parent = $ENV{WORK_DIR} || File::Spec->tmpdir;
21 my $dir = tempdir( CLEANUP => 1, DIR => $parent );
22 #my $dir = tempdir( DIR => '.' );
25 my ($fh, $filename) = tempfile( 'tmpXXXX', DIR => $dir, UNLINK => 1 );
27 # This is because tempfile() returns a flock'ed $fh on MacOSX.
30 return ($fh, $filename);