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

_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to