package My::Handler; sub handler { my $r = shift; # translate from URL to package name, and the "action" # that you want to perform my($pkg, $action) = figure_out_package_name($r->uri); # instantiate, and call the appropriate handler my $obj = $pkg->new(); $obj->dispatch($action); } #### sub dispatch { my($self, $action) = @_; my $my_r = My::Apache::Request->new(Apache->request); $self->do_the_appropriate_thing($action, $my_r); }