On Tue, 2007-06-05 at 22:30 +1000, Charlie Garrison wrote:
> Good evening,
> 
> On 5/6/07 at 1:17 AM +0100, Matt S Trout 
> <[EMAIL PROTECTED]> wrote:
> 
> >> in lib/MyApp.pm:
> >>   use Catalyst qw/
> >+MyApp::Plugin::DebugMode
> >> ...
> >> /;
> >
> >The + is important.
> 
> Would you mind explaining that a bit further? Or pointing to 
> documentation? When is it appropriate to use the + and what 
> purpose does it serve?
> 
> Thanks,
> Charlie
> 

Normally, Catalyst will look for plugins starting in the
Catalyst::Plugin namespace. So, having a line like...

use Catalyst qw/
    Session
    /;

Will actually look for and load the Catalyst::Plugin::Session package.
The '+' signifies that the plugin is being specified as a
fully-qualified package name. So Catalyst doesn't search within
Catalyst::Plugin for that plugin, it just looks for the package name as
is.

So...

use Catalyst qw/
    +MyApp::Plugin::DebugMode
    /;

will load the MyApp::Plugin::DebugMode package. Without the '+' it would
try to find Catalyst::Plugin::MyApp::Plugin::DebugMode.

Hope this helps.

v/r

Matt Pitts

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to