perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jordan McLain" <jordan.mcl...@gmail.com>
Subject method handlers
Date Fri, 27 Oct 2006 03:16:40 GMT
Hello,

This is more of a style and usage question.  Sorry for the stupid question.

I am rewriting one of my apps to be more OO so that I can abstract
its' functionality out to another handler potentially.  I end up doing
something like this...

sub handler {
 my ($class, $r) = @_;

 my $self = ... # something hashref-ish

 bless $self, $class;

 ...

 my $method = $modes{$mode}; # hash lookup of available modes

 $self->$method;

 return OK;
}

I will end up writing another "new()" for use when not called directly
from apache.  Is this bad style, since the method does not return the
blessed ref to something, but instead calls methods directly with the
blessed ref?

thanks,
Jordan Mclain
eCarList.com

Mime
View raw message