From 081f2fb3772d0c38bfba4bd23c4f834c7c6c7200 Mon Sep 17 00:00:00 2001 From: Todd Rinaldo Date: Mon, 8 Oct 2018 18:10:55 -0500 Subject: [PATCH] Do not re-load Plugins if they're already present. Resolves GH #112 --- lib/Template/Plugins.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Template/Plugins.pm b/lib/Template/Plugins.pm index a260f7c87..f77ba51c6 100644 --- a/lib/Template/Plugins.pm +++ b/lib/Template/Plugins.pm @@ -189,7 +189,7 @@ sub _load { $file =~ s|::|/|g; $self->debug("loading $module.pm (PLUGIN_NAME)") if $self->{ DEBUG }; - $ok = eval { require "$file.pm" }; + $ok = eval { $module->isa("Template::Plugin") or require "$file.pm" }; $error = $@; } else { @@ -203,7 +203,7 @@ sub _load { $self->debug("loading $file.pm (PLUGIN_BASE)") if $self->{ DEBUG }; - $ok = eval { require "$file.pm" }; + $ok = eval { $pkg->isa("Template::Plugin") or require "$file.pm" }; last unless $@; $error .= "$@\n"