moritz has asked for the wisdom of the Perl Monks concerning the following question:
For some tasks it would be cool to redirect STDOUT to a file or to a scalar (with IO::Scalar), but only in certain scope.
Of course local STDOUT dies with Can't modify constant item in local....
Is there a clean solution?
Update: I just found IO::String and select which works for STDOUT, but is there a way for STDERR as well? I don't need it, I'm just curious ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Redirecting STDOUT, lexically scoped
by wind (Priest) on Jul 31, 2007 at 09:43 UTC | |
by moritz (Cardinal) on Jul 31, 2007 at 10:12 UTC | |
by radiantmatrix (Parson) on Jul 31, 2007 at 14:51 UTC | |
by mfwitten (Initiate) on Apr 11, 2009 at 02:29 UTC | |
|
Re: Redirecting STDOUT, lexically scoped
by FunkyMonk (Bishop) on Jul 31, 2007 at 09:45 UTC |