use strict; my $out; { open local(*STDOUT), '>', \$out; foo(); } print "Std: $out\n"; sub foo{ print "from foo"; }
In reply to Re: Challenge: Capturing stdout from a function call.
by johnnywang
in thread Challenge: Capturing stdout from a function call.
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |