in reply to Could I redirect stdout back into my script?
This will preserve whatever stdout_sub() printed in the string $output_string.require 5.004; use strict; use IO::Scalar; my $output_string = ''; tie *STDOUT, 'IO::Scalar', \$output_string; &stdout_sub(); untie *STDOUT; sub stdout_sub { print "This will not print to screen.\n"; }
stephen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Could I redirect stdout back into my script?
by runrig (Abbot) on Apr 22, 2001 at 04:01 UTC | |
by stephen (Priest) on Apr 22, 2001 at 04:17 UTC |