On a POSIX system, you can do the following. On Windows, this will work in cygwin .
my @lines = capture("some command 2>&1");
However, if you want to distinguish STDERR strings from STDOUT strings, you might need to use IPC :: Open3 or the incorrectly named IPC :: Open3 :: Util .
Leolo source
share