perl-modperl mailing list archives

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

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


 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?

Jordan Mclain

View raw message