1 package # Hide from PAUSE
18 use File::Temp qw( tempfile tempdir );
19 use Fcntl qw( :flock );
21 my $parent = $ENV{WORK_DIR} || File::Spec->tmpdir;
22 my $dir = tempdir( CLEANUP => 1, DIR => $parent );
23 #my $dir = tempdir( DIR => '.' );
26 my ($fh, $filename) = tempfile( 'tmpXXXX', DIR => $dir, UNLINK => 1 );
28 # This is because tempfile() returns a flock'ed $fh on MacOSX.
31 return ($fh, $filename);
36 my ($fh, $filename) = new_fh();
38 [ file => $filename ],
41 return unless @extra_args;
42 my @these_args = @{ shift @extra_args };