- "Maypole::$_"->require or warn qq(Loading plugin "Maypole::$_" failed);
- unshift @ISA, "Maypole::$_";
+ if (/^\-Setup$/) { $caller->setup }
+ elsif (/^\-Debug$/) {
+ *{"$caller\::debug"} = sub { 1 };
+ warn "Debugging enabled";
+ }
+ else {
+
+ # The plugin caller should be our application class
+ eval "package $caller; require Maypole::Plugin::$_";
+ if ($@) { warn qq(Loading plugin "Maypole::Plugin::$_" failed: $@) }
+ else {
+ warn "Loaded plugin: Maypole::Plugin::$_" if $caller->debug;
+ unshift @ISA, "Maypole::Plugin::$_";
+ }
+ }