perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dorian Taylor <dor...@foobarsystems.com>
Subject Re: Switch and mod_perl
Date Fri, 24 Jun 2005 05:41:23 GMT
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;

# or whatever.

.d

Mime
View raw message