in reply to Problems with open3

If you just want to capture the output from some external program, you can use backquotes:
my $ssh_version = `ssh -V`; chomp $ssh_version; printf "[%s]\n", $ssh_version;

If you really need IPC::Open3, you should know that it is a quite complex module under the hood. In my experience, one of the best ways to troubleshoot it is to use strace or some similar tool.

Also, there are several alternative modules on CPAN that may work better for you.

Replies are listed 'Best First'.
Re^2: Problems with open3
by RonW (Parson) on Oct 15, 2014 at 17:01 UTC

    To capture STDERR with backquotes, use:

    $output = `cmd 2>&1 1>/dev/null`;

    If you want both, omit redirecting STDOUT to /dev/null:

    $output = `cmd 2>&1`;

    However, it is generally safer to use open3.