Have you looked at Capture::Tiny? ...a third way, but it works great.
From the synopsis:
use Capture::Tiny ':all'; # capture from external command ($stdout, $stderr, $exit) = capture { system( $cmd, @args ); };
Dave
In reply to Re: Correct way to capture command output to a file in Perl.
by davido
in thread Correct way to capture command output to a file in Perl.
by perl514
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |