Feeling a little pedantic but I've already irretrievably destroyed my
reputation...

> package Qpsmtpd::Address;
> use Qpsmtpd::Constants;
>
> sub config {
>     my ($self, $c, $arg) = @_;
>     return 42;
> }
> ----snip---------------------------------------------------------------

I'm not entirely sure that will work (because of the way that plugins
are wrapped).  If that works, it would be better, otherwise you'd have
to use eval tricks in the init() sub of the plugin.

unless the plugin wrapper somehow clobbers everything in the name space
before loading its methods, or you are clobbering a pre-existing method (which
will create a warning) there's no reason not to write methods for one package
in a different one (AIUI, all the "package" pragma does is change the default
name space, and nothing else) so the above could be equivalently written as

use Qpsmtpd::Constants; # presuming this will be needed and isn't
already available here
sub Qpsmtpd::Address::config {
    my ($self, $c, $arg) = @_;
    return 42;
}


--
David L Nicol
you only get one stone per turn

Reply via email to