in reply to getting STDERR from external command using OPEN

For what you want to do Capture::Tiny is the best

use Capture::Tiny qw/ capture /; my @cmd = ( "...ls", 'dir' ); my( $stdout, $stderr, $exit ) = capture { system { $cmd[0] } @cmd; };; $exit and die "it failed with $exit and $stderr ";

The alternatives are IPC::Open2, IPC::Open3...

  • Comment on Re: getting STDERR from external command using OPEN (open2/open3/Capture::Tiny)
  • Download Code

Replies are listed 'Best First'.
Re^2: getting STDERR from external command using OPEN (open2/open3/Capture::Tiny)
by gabrielsousa (Sexton) on Nov 09, 2016 at 11:07 UTC
    thanks , i have perl-Capture-Tiny on Cygwin :)