From 819f986c3611af387dd9ad9374b4b5fc8eeb1771 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 eceb5ac6..5895123b 100644 --- a/lib/Template/Plugins.pm +++ b/lib/Template/Plugins.pm @@ -186,7 +186,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 { @@ -200,7 +200,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"