Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: getting STDERR from external command using OPEN (open2/open3/Capture::Tiny)

by Anonymous Monk
on Nov 09, 2016 at 03:31 UTC ( #1175579=note: print w/replies, xml ) Need Help??


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 :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1175579]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2021-10-21 19:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (83 votes). Check out past polls.

    Notices?