- $self->{tmp_file} = $tmp_file;
- my ($vol, $dir) = File::Spec->splitpath($self->{tmp_file});
- $self->{tmp_dir} = File::Spec->catpath($vol, $dir, '');
+ $args{SUFFIX} = $exe_ext if length $exe_ext;
+ my $tmp_file = do {
+ local $^W = 0;
+ (File::Temp::tempfile(%args))[1]
+ };
+ $self->{tmp_file} = $tmp_file;
+ my ($vol, $dir) = File::Spec->splitpath($self->{tmp_file});
+ $self->{tmp_dir} = File::Spec->catpath($vol, $dir, '');