Moving STDOUT to a new handle?

[prev] [thread] [next] [Date index for 2004/11/08]

From: Arne Skjaerholt
Subject: Moving STDOUT to a new handle?
Date: 17:15 on 08 Nov 2004
------=_Part_19736_5771047.1099934135291
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 7bit

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


------=_Part_19736_5771047.1099934135291
Content-Type: text/plain; charset=us-ascii

        -- 
        Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
------=_Part_19736_5771047.1099934135291--

Moving STDOUT to a new handle?
Arne Skjaerholt 17:15 on 08 Nov 2004

Re: SV: Moving STDOUT to a new handle?
William McKee 18:53 on 08 Nov 2004

Re: Moving STDOUT to a new handle?
Perrin Harkins 22:29 on 08 Nov 2004

Generated at 11:26 on 21 Dec 2004 by mariachi v0.52