in reply to Redirecting STDOUT
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'";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Redirecting STDOUT
by mt2k (Hermit) on Jun 15, 2002 at 04:20 UTC |