[Catalyst] setup() called twice

Matt S Trout dbix-class at trout.me.uk
Tue Jun 19 15:42:32 GMT 2007


On Tue, Jun 19, 2007 at 09:50:30AM +0100, Matt Lawrence wrote:
> Quinn Weaver wrote:
> > On Mon Jun 18 20:04:09 GMT 2007, Matt Trout wrote:
> >> No it isn't. The redefine means it -isn't- called a second time.
> >>     
> >
> > Yes it is.  You can verify this by running myapp_server.pl under the debugger,
> > or by putting lines like this in MyApp::setup:
> >
> >     warn "setup called by process $$ at ", scalar localtime();
> >
> >   
> >> But all the plugins' setup() methods (which weren't in @ISA when setup was
> >> first called) -are- called.
> >>     
> >
> > Thanks--I see the motivation now.  But it seems to have the unintended side
> > effect of calling MyApp::setup twice.
> >
> >   
> What's wrong with:
> 
> $_->setup for keys %{$self->_plugins};

Setup order matters.

-- 
      Matt S Trout       Need help with your Catalyst or DBIx::Class project?
   Technical Director    Want a managed development or deployment platform?
 Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/ 



More information about the Catalyst mailing list