From: Marcus Ramberg Date: Wed, 29 Sep 2004 23:15:54 +0000 (+0000) Subject: support use Maypole qw/Redirect Poop/ syntax. (Maypole::Poop soon to follow) X-Git-Tag: 2.10~149 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=096873aa586d1f883c262261ee7c67239c071fc0;p=maypole.git support use Maypole qw/Redirect Poop/ syntax. (Maypole::Poop soon to follow) git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@213 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/lib/Maypole/Application.pm b/lib/Maypole/Application.pm index c2d58dc..b6789a8 100644 --- a/lib/Maypole/Application.pm +++ b/lib/Maypole/Application.pm @@ -3,13 +3,24 @@ package Maypole::Application; use strict; use warnings; +our @ISA; + +sub import { + my ( $self, @plugins ) = @_; + return unless $plugins[0]; + my $caller=caller(0); + no strict 'refs'; + push @{"${caller}::ISA"}, $self; + "Maypole::$_"->require && unshift @ISA, "Maypole::$_" foreach (@plugins); +} + if ( $ENV{MOD_PERL} ) { require Apache::MVC; - our @ISA = qw(Apache::MVC); + push @ISA , qw(Apache::MVC); } else { require CGI::Maypole; - our @ISA = qw(CGI::Maypole); + push @ISA , qw(CGI::Maypole); } 1;