open STDOUT, ">", \$TEMP1;
See my reply to Using a tied scalar as an in memory file for why this generally cannot be used to capture the stdout/stderr output of external programs.
You need to setup pipes both ways to the I/O of the external program, which can for example be achieved with IPC::Open3. But even in this case it's sometimes non-trivial to get right (due to potential buffering and deadlock problems, depending on how the external program is behaving...).
In reply to Re: Question: Redirection of stdout to scalar variable
by almut
in thread Question: Redirection of stdout to scalar variable
by jujiro_eb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |