perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arne Skjaerholt <arnsh...@online.no>
Subject Moving STDOUT to a new handle?
Date Mon, 08 Nov 2004 17:15:35 GMT
Hello everyone,
I am currently workning on writing a CMS system, and as such I'd like to prevent user modules
from outputting data directly instead of using the method supplied by the system. The way
I would like to this is opening a new filehandle in the mian module (lexically scoped so noone
else can get at it) and then retying STDOUT to a module that logs all attempts to use the
filehandle.
Now, having done my research I found that STDOUT is tied to the Apache class, and that simply
duping STDOUT isn't sufficient (it doesn't conserve the tie). I also found that saying tie
*NEWOUT, "Apache"; doesn't do the necessary magic to make the new handle work.
So, is there a way I can move STDOUT to a new handle, or do I have no other choice than to
say "please don't use direct output"?

Thanks in advance,
Arne
:wq


Mime
View raw message