perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Eden <li...@janeden.org>
Subject Re: Switch and mod_perl
Date Fri, 24 Jun 2005 07:33:13 GMT
Dorian Taylor wrote on 24.06.2005:

>On Thu, Jun 23, 2005 at 03:19:22PM -0400, Perrin Harkins wrote:
>> On Thu, 2005-06-23 at 10:46 +0200, Jan Eden wrote:
>> > could it be that mod_perl doesn't play nice with the Switch module?
>> 
>> Isn't it a source filter?  Those don't work with mod_perl.
>> 
>> You probably shouldn't use Switch for anything serious.  Even Damian
>> says so.
>
>no doubt. i consider dispatch tables much more elegant anyway.
>
>sub stuff {
>   # ...
>}
>
>my %DISPATCH = (
>   Foo => \&stuff,
>   Bar => \&whatever,
>);
>
># then ...
>
>my $result = $DISPATCH{$param} ? $DISPATCH{$param}->(@args) : undef;
>

I'll switch to that solution, then. ;)

Thanks Perrin and Dorian,

Jan
-- 
Bad spellers of the world Untie!

Mime
View raw message