From 3707751b424c38da6985d17c02bc7ff4d0fee7dd Mon Sep 17 00:00:00 2001 From: John Peacock Date: Thu, 14 Jul 2005 11:05:11 +0000 Subject: [PATCH] This fixes the redefined warnings. All plugins don't have register() any more, but they all have plugin_name(). git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.31@505 958fd67b-6ff1-0310-b445-bb7760255be9 --- lib/Qpsmtpd.pm | 2 +- lib/Qpsmtpd/Plugin.pm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Qpsmtpd.pm b/lib/Qpsmtpd.pm index 382aea7..b5b7169 100644 --- a/lib/Qpsmtpd.pm +++ b/lib/Qpsmtpd.pm @@ -230,7 +230,7 @@ sub _load_plugins { my $package = "Qpsmtpd::Plugin::$plugin_name"; # don't reload plugins if they are already loaded - unless ( defined &{"${package}::register"} ) { + unless ( defined &{"${package}::plugin_name"} ) { Qpsmtpd::Plugin->compile($plugin_name, $package, "$dir/$plugin", $self->{_test_mode}); $self->log(LOGDEBUG, "Loading $plugin_line") diff --git a/lib/Qpsmtpd/Plugin.pm b/lib/Qpsmtpd/Plugin.pm index 48f3a43..6f8b124 100644 --- a/lib/Qpsmtpd/Plugin.pm +++ b/lib/Qpsmtpd/Plugin.pm @@ -94,8 +94,8 @@ sub isa_plugin { $cleanParent =~ s/\W/_/g; my $newPackage = $currentPackage."::_isa_$cleanParent"; - - return if defined &{"${newPackage}::register"}; + # don't reload plugins if they are already loaded + return if defined &{"${newPackage}::plugin_name"}; $self->compile($self->plugin_name . "_isa_$cleanParent", $newPackage,