I want to call a EXE file in Perl which performs some action
I tried calling the exe file via backtick and system but in both the cases i get only the return value
The exe file prints some text on to the console. Is it possible to capture that as well?
I looked into this variable ${^CHILD_ERROR_NATIVE} but I get only the return value and not text
I am using Perl 5.14
Thanks in advance
The application might not print its output to
STDOUTbutSTDERRinstead, which isn’t captured by the backtick operator. To capture both, you could use the following:For a more fine-tuned capturing, you might want to resort to
IPC::Open3with which you can “control” all of a process’ streams (IN,OUTandERR).