Another useful option is the module Capture::Tiny, which combines with system to return the external programme’s exit status while also capturing its output to STDOUT and to STDERR. For example:
use Capture::Tiny 'capture'; ... my ($stdout, $stderr, $exit) = capture { system($cmd, @args); };
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: Calling external commands through my script
by Athanasius
in thread Calling external commands through my script
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |