|
|
| Do you know where your variables are? | |
| PerlMonks |
Re: Capture external program return valueby tokpela (Chaplain) |
| on May 02, 2010 at 04:05 UTC ( #837974=note: print w/ replies, xml ) | Need Help?? |
|
IPC::Run3 will allow you to capture the output as well as the return code from the program you are running. Untested late night code ;-)
From the docs... run3 throws an exception if the wrapped system call returned -1 or anything went wrong with run3's processing of filehandles. Otherwise it returns true. It leaves $? intact for inspection of exit and wait status. Note that a true return value from run3 doesn't mean that the command had a successful exit code. Hence you should always check $?. Updated with Perlbotics and Hue-Bond suggested use of qw{}.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||