in reply to mod_perl & TT2 Architecture
If any one has any comments on this I'd love to hear them.package Handler; use strict; use warnings; my %handlers = ( '/' => 'Handler::Index', '/logout' => 'Handler::Logout', '/details' => 'Handler::Details', ); sub handler ($$) { my $self = shift; my $r = shift; $self = $self->new( r => $r ) unless ref $self; my $uri = $r->uri; # User auth etc. can happen here. if ( my $handler = $handlers{ $uri } ) { eval "require $handler" || die "Error with $handler"; return $handler->handler( $r ); } # If not on list then it was not found. return NOT_FOUND; } ######### # httpd.conf <Location /> SetHandler perl-script PerlHandler Handler </Location>
--tidiness is the memory loss of environmental mnemonics
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: mod_perl & TT2 Architecture
by perrin (Chancellor) on May 25, 2004 at 16:51 UTC | |
by EvdB (Deacon) on May 25, 2004 at 17:22 UTC | |
by perrin (Chancellor) on May 25, 2004 at 17:44 UTC | |
by EvdB (Deacon) on May 26, 2004 at 07:51 UTC |