in reply to Using IPC::Open3 instead of backtick operator
How is this an improvement? Is there a better way to Use IPC::Open3 instead of backticks?
It isn't, they're not equivalent, using open3 is like using open, not like using backticks,
as Perl::Critic::Policy::InputOutput::ProhibitBacktickOperators tells it, backticks is more like "capture" from IPC::System::Simple
Capture::Tiny is what you want
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 ";
Also of interest might be String::ShellQuote/Win32::ShellQuote
|
|---|