[Catalyst] Calling form plugin authors: these should not be plugins

Perrin Harkins perrin at elem.com
Wed Nov 22 21:12:50 GMT 2006


John Napiorkowski wrote:
> One thing that would help with this is if there was
> some clear instructions about how to add external perl
> modules to a global namespace in Catalyst.  I find I
> end up with:
> 
> package myapp::Controller::foo;
> 
> use Other::Module;
> use Another::Usefull::Module;
> 
> at the top of a lot of controllers.  I usually end up
> creating a base controller with all those modules I
> typically use and inherit from that instead of from
> Catalyst Controller.

That's a good way to do it.

> People who did mod_perl
> programming are used to preloading stuff and having it
> available, however I haven't figured out how this
> works in Catalyst.

You mean preloading a bunch of modules in startup.pl and then not 
calling use() on them in modules that need them?  That ought to work in 
Catalyst, but I don't recommend doing it.  Listing the modules you need 
explicitly in your controller makes the dependencies easier to see.  It 
also makes it easier if you use them in test scripts, where the modules 
may not be loaded already.

- Perrin



More information about the Catalyst mailing list