in reply to Capturing both STDERR and STDOUT without shell redirect

Check out IPC::Run3

  • Comment on Re: Capturing both STDERR and STDOUT without shell redirect

Replies are listed 'Best First'.
Re^2: Capturing both STDERR and STDOUT without shell redirect
by fullermd (Vicar) on Aug 06, 2009 at 19:18 UTC

    Seconded. I've made use of it in several scripts where I want to get a hold of all the bits of output, not mashed together, as well as the return value. Looking at one for a quick sample:

    # Way earlier use IPC::Run3; # Run it my (@out, @err); run3 \@cmd, \undef, \@out, \@err or die "run3 failed: $!"; # Return val my $rval = $? >> 8;