[cgiapp] packages autouse?

Richard Jones ra.jones at dpw.clara.co.uk
Fri Jun 12 10:07:53 EDT 2009


Rhesa Rozendaal wrote:
> Heh, I use Module::Pluggable for that in my startup.pl:
> 
> use Module::Pluggable require => 1, search_path => [qw(
>   My
>   Other::Stuff
> )];
> __PACKAGE__->plugins;
> 
> That would load everything under My::* and Other::Stuff::*.

Can Module::Pluggable be used as an alternative to Module::Find? I load 
all my Model::DB classes up front in a BEGIN block in MyApp::Base, like 
this:

BEGIN {
   use Module::Find;

   Module::Find::setmoduledirs('path/to/lib');
   Module::Find::useall MyApp::DB;
}

use Module::Pluggable
   require => 1,
   search_dirs => [ 'path/to/lib/MyApp/DB' ]

For this to work I need the Module::Pluggable equivalent of useall().
--
Richard Jones


More information about the cgiapp mailing list