perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <ge...@modperlcookbook.org>
Subject Re: Dynamlcally loading modules at run-time
Date Thu, 03 Oct 2002 14:53:59 GMT


Jochen Lillich wrote:
> Hi,
> 
> I'm writing my first mod_perl handler. I'd like to make the handler some
> kind of dispatcher that dynamically loads certain modules depending on
> the URI called:
> 
> /foo/index => require foo; $result = foo::index();
> /foo/other => require foo; $result = foo::other();
> /bar/index => require bar; $result = bar::index();

look into Apache::Dispatch.  I haven't touched the code in a while, 
but it does what you're seeking.

> 
> I'd like to ask for your advice there. Is this a clever way to go in
> the first place? And how would i best code this concept? Or is there a
> better way to reach a modular structure in a big web application?

probably :)  try looking at things like Mason, Embperl, Template 
Toolkit, Apache::ASP...

--Geoff


Mime
View raw message