perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <>
Subject Re: How do my handler call dynamically a module based the request input
Date Tue, 06 Aug 2002 01:08:05 GMT

Harry Zhu wrote:

> That will do the work, but the thing is I need add "no strict" before such
> statements, maybe in many places.
> I can also do like
> $result =  A::B1::C->(@params) if $module_call eq 'B1';
> $result =  A::B2::C->(@params) if $module_call eq 'B2';
> $result =  A::B3::C->(@params) if $module_call eq 'B3';
> ...
> but it's not flexible, even not feasible when more and more Bs added to the
> list.
> Is there any other way that seems less odd to do the similar dispatch work?

you might want to check out Apache::Dispatch (on CPAN), which does this 
kind of URI->method translation thing for you.


View raw message