[QUESTION] Overloading/overriding print() when subclassing Apache

[prev] [thread] [next] [Date index for 2005/05/14]

From: Arne Skjaerholt
Subject: [QUESTION] Overloading/overriding print() when subclassing Apache
Date: 23:37 on 14 May 2005
Hello all,
I'm currently working on a project where I've decided to subclass
Apache, and one of the methods I've decided to overload is the print
method (so that my main module decides when data actually gets printed,
not user modules). Now, I'd like to also override the built-in perl
print (like Apache has done) so that module authors can say print
( @my_data ) instead of MyModule::Request->print ( @my_data ).
Currently I've tried  the following:
sub PRINT
{
	MyModule::Request->print ( @_ );
}
*print = \&PRINT;

and:

# Same PRINT() as above.
*CORE::GLOBAL::print = \&PRINT;

and:

*CORE::print = \&PRINT;

None of them have garnered any success worth mentioning. Explicitly
saying MyModule::Request->print ( @my_data ); works as I intended. Does
anyone have any ideas as to what I'm doing wrong here?

Thanks in advance,
Arne
:wq

[QUESTION] Overloading/overriding print() when subclassing Apache
Arne Skjaerholt 23:37 on 14 May 2005

Generated at 15:53 on 25 May 2005 by mariachi v0.52