'File::HomeDir' => '0.86',
'File::Path' => 0,
'File::Spec' => 0,
- 'File::Temp' => '0.14', # OO interface
+ 'File::Temp' => '0.19', # ->newdir in tests
'Filter::Util::Call' => 0,
'Fcntl' => 0,
'IO::Select' => 0,
my %BUILD_REQUIRES = (
%CONFIGURE_REQUIRES,
- 'File::Temp' => 0,
+ 'File::Temp' => '0.19', # ->newdir in tests
'IO::Handle' => 0,
'IO::Select' => 0,
'IPC::Open3' => 0,
FAKE_VG
}
+my $good_enough_file_temp;
+BEGIN {
+ $good_enough_file_temp = do {
+ no warnings;
+ local $@;
+ eval { File::Temp->VERSION('0.19'); 1 }
+ }
+}
+
sub new {
my ($class, %args) = @_;
my $self = { };
if (defined $exe_name) {
+ return 'File::Temp 0.19 is required to make a proper temporary directory'
+ unless $good_enough_file_temp;
$self->{tmp_dir_obj} = File::Temp->newdir(CLEANUP => 1);
$self->{tmp_dir} = $self->{tmp_dir_obj}->dirname;
$self->{tmp_file} = File::Spec->catfile($self->{tmp_dir}, $exe_name);