You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by André Warnier <aw...@ice-sa.com> on 2009/11/23 23:24:18 UTC

Apache2/mod_perl2 test in module

Hi.

I created a perl object module which can be used by mod_perl2 handlers, 
cgi scripts, or stand-alone perl programs.
It has a new() method which creates an object $obj, which is later used 
via standard $obj->method() calls.
What would be a recommended/elegant mechanism/idiom, to have this module 
log warnings and errors appropriately, depending on where it is 
currently being used, e.g. :
- to the Apache2 error log when it is used within Apache/mod_perl2
- warn() if it is used by a stand-alone program
- ?? when used in a cgi script

Thanks for ideas/examples/pointers.