]> git.donarmstrong.com Git - term-progressbar.git/blobdiff - t/compat.t
use File::Temp
[term-progressbar.git] / t / compat.t
index 9aa8efca0dbfb1f829fd0892777ae9923c29381a..daba215626f1c3c3a78abc918112ec4bb9539954 100644 (file)
@@ -35,8 +35,9 @@ BEGIN {
 sub grab_output($) {
     die 'usage: grab_stderr(string to eval)' if @_ != 1;
     my $code = shift;
-    require POSIX;
-    my $tmp_o = POSIX::tmpnam(); my $tmp_e = POSIX::tmpnam();
+       use File::Temp qw(tempdir);
+       my $dir = tempdir( CLEANUP => 1 );
+    my $tmp_o = "$dir/out"; my $tmp_e = "$dir/err";
     local (*OLDOUT, *OLDERR);
 
     # Try to get a message to the outside world if we die