Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

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

by Anonymous Monk
on Nov 09, 2016 at 03:31 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found