in reply to Challenge: Capturing stdout from a function call.
use strict; my $out; { open local(*STDOUT), '>', \$out; foo(); } print "Std: $out\n"; sub foo{ print "from foo"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Challenge: Capturing stdout from a function call.
by melora (Scribe) on Oct 21, 2004 at 23:33 UTC | |
by BUU (Prior) on Oct 22, 2004 at 03:55 UTC |