See open, where your case is discussed:
close STDOUT; open STDOUT, '>', \$variable or die "Can't open STDOUT: $!";
In reply to Re: Redirect STDOUT to a $variable
by Corion
in thread Redirect STDOUT to a $variable
by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |