perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arne Skjaerholt <>
Subject [QUESTION] Overloading/overriding print() when subclassing Apache
Date Sat, 14 May 2005 23:37:07 GMT
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:
	MyModule::Request->print ( @_ );
*print = \&PRINT;


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


*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,

View raw message