in reply to Re^2: capture stdout and stderr from external command
in thread capture stdout and stderr from external command

All I need is to get the stdout and stderr of the executable executed using the system command into some perl variable

Your problem is that forking puts the $cmd into a different $pid, and if you put your stdout and stderr into a perl variable, it won't be seen in the parent. You will need to open some pipes from the children back to the parent, to write back your returns. Or, you could use threads or some other form of IPC, like shared memory segments. See forking with Storable and IPC::ShareLite


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re^3: capture stdout and stderr from external command