From 89c6378ceb590bd961b2648b1858dca2b4c88e97 Mon Sep 17 00:00:00 2001 From: Gabor Szabo Date: Tue, 29 Nov 2011 15:15:45 +0200 Subject: [PATCH] use File::Temp --- t/compat.t | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/t/compat.t b/t/compat.t index 9aa8efc..daba215 100644 --- a/t/compat.t +++ b/t/compat.t @@ -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 -- 2.39.2