[Catalyst] Incorporating PerlHandlers into Catalyst app

Jules Bean jules at jellybean.co.uk
Fri Nov 18 11:59:49 CET 2005


Kevin Old wrote:
> Hello everyone,
> 
> I have an existing set of PerlHandlers being used by mod_perl and
> wondered how hard it would be to incorporate them into a Catalyst
> application?  Has anyone done this?
> 
> Could it be as simple as adding them to my use statement in MyApp.pm
> and then adjusting the subroutine declarations into using the Catalyst
> declarations to control flow?
> 
> Any help is appreciated!

Well there are two ways, generically.

One is, given a PerlHandler myHandler, to write a MyApp::C::MyHandler 
wrapper (or delegation) module which simply forwards catalyst-dispatches 
  to myHandler routines.

The other is to refactor myHandler, making it a controller its own right.

Which is best depends on various things, including whether or not there 
is value in continuing to maintain myHandler independently.

Depending how to structured your PerlHandlers in the first place, there 
is a possibility that you weren't using MVC, which may make it harder to 
make it 'feel like' a Catalyst App.  (Although there is absolutely 
nothing in the framework which forbids you from having a controller 
doing the whole job, and just forgetting about mvc separation).

Jules



More information about the Catalyst mailing list