Just another Perl shrine | |
PerlMonks |
problems redirecting STDOUT and STDERR to a $variableby jeanluca (Deacon) |
on Feb 15, 2008 at 13:18 UTC ( [id://668132]=perlquestion: print w/replies, xml ) | Need Help?? |
jeanluca has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks I'm trying to redirect both STDOUT and STDERR to the same variable. Here is the test code: Output: So, line 29 has a problem while line 28 has not, any suggestions why? Next I tried to run it as a cgi program (with apache): In the browser I get nothing(blank), but running it from the commandline I get what I expected: But if I remove the line select STDERR; $| = 1; everything works fine in the browser too! Any reason why ? or should I do this differently ? Thnx a lotLuCa ps I'm using perl v5.8.8 on Linux Update Thnx monks, thats what I needed!!
Back to
Seekers of Perl Wisdom
|
|