From 096873aa586d1f883c262261ee7c67239c071fc0 Mon Sep 17 00:00:00 2001 From: Marcus Ramberg Date: Wed, 29 Sep 2004 23:15:54 +0000 Subject: [PATCH] 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 --- lib/Maypole/Application.pm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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; -- 2.39.2