On 2005-07-06 20:58:21 -0400, Matt Sergeant wrote: > On 6 Jul 2005, at 20:47, Gavin Carr wrote: > > >What about just using named arguments and honouring 'nolog => 1' or > >something? > > Yeah I guess we may have to bite the bullet on that soon. We talked > about it a while ago. The only downside is that they're not used > anywhere else in the source so it's a bit of a deviation from what's > currently done. >
In a qpsmtpd-0.28+patches I still have running Qpsmtpd::config looks
like this:
sub config {
my ($self, $c, $arg) = @_;
my $type;
if (ref $arg) {
$type = $arg->{type};
} else {
$type = $arg;
$arg = { type => $type };
}
#warn "SELF->config($c) ", ref $self;
my %defaults = (
me => hostname,
timeout => 1200,
);
my ($rc, @config) = $self->run_hooks("config", $c, $arg);
unless ($rc == OK) {
@config = $self->get_qmail_config($c, $type);
@config = ( $defaults{$c} ) if ([EMAIL PROTECTED] and $defaults{$c});
}
return wantarray ? @config : $config[0];
}
I think this particular patch was from Gavin. It allows either the simple
string "map" as the second argument (for backwards compatibility), or a
hashref, so you could call
$self->config("foo", "map")
$self->config("foo", { type => "map"})
$self->config("foo", { nolog => 1})
hp
--
_ | Peter J. Holzer | Ich sehe nun ein, dass Computer wenig
|_|_) | Sysadmin WSR | geeignet sind, um sich was zu merken.
| | | [EMAIL PROTECTED] |
__/ | http://www.hjp.at/ | -- Holger Lembke in dan-am
pgpV3idXJMSAt.pgp
Description: PGP signature
