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"