]> git.donarmstrong.com Git - term-progressbar.git/commitdiff
use File::Temp
authorGabor Szabo <gabor@szabgab.com>
Tue, 29 Nov 2011 13:15:45 +0000 (15:15 +0200)
committerGabor Szabo <gabor@szabgab.com>
Tue, 29 Nov 2011 13:15:45 +0000 (15:15 +0200)
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