[Catalyst] Catalyst.pm code does what?
Yuval Kogman
nothingmuch at woobling.org
Wed Jan 18 11:55:47 CET 2006
On Wed, Jan 18, 2006 at 10:44:10 +0000, Carl Franks wrote:
> In Catalyst.pm , subroutine setup (line 659 - svn r3100)
> what is this code supposed to do / why is it needed?
>
>
> # Call plugins setup
> {
> no warnings qw/redefine/;
> local *setup = sub { };
> $class->setup;
> }
MyApp->setup goes to Catalyst::setup first, because at this stage
MyApp isa Catalyst, but not any of the plugins.
This loads all the plugins and components and what not, and then
temporarily empties Catalyst::setup, and re-invokes MyApp->setup.
This then goes into all the plugins' setup snippets, which call
MyApp->NEXT::setup until the last one is reached, and it goes into
the 'sub { }'.
Basically it emulates the behavior that should happen if
MyApp->setup was called and all the plugins are alreay loaded and
in @MyApp::ISA
--
() Yuval Kogman <nothingmuch at woobling.org> 0xEBD27418 perl hacker &
/\ kung foo master: MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM: neeyah!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060118/e54ad132/attachment.pgp
More information about the Catalyst
mailing list