[Catalyst] debug mode

Matthew Pitts mpitts at a3its.com
Tue Jun 5 13:52:49 GMT 2007


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 
> <dbix-class at trout.me.uk> 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



More information about the Catalyst mailing list