I hope this works for you.use IO::Scalar; my $output; tie (*STDOUT, 'IO::Scalar', \$output); # Use this to capture STDOUT print "testout\n"; untie *STDOUT; # Use this to return STDOUT to normal print "my output='$output'";
In reply to Re: Redirecting STDOUT
by SarahM
in thread Redirecting STDOUT
by tame1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |