[Catalyst] setup() called twice

Bill Moseley moseley at hank.org
Tue Jun 19 19:22:52 GMT 2007


On Tue, Jun 19, 2007 at 07:02:42PM +0100, Matt S Trout wrote:
> > I'd be fairly willing to say this is a bug and it should be doing
> > 
> > {
> >   no strict 'refs';
> >   no warnings 'redefine';
> >   local *{"${appclass}::setup"} = sub { shift->NEXT::setup(@_); };
> >   local *setup = sub {};
> >   $app->setup;
> > }
> > 
> > Maybe somebody could put together a test case for this behaviour?
> 
> *PROD*
> 
> Quinn, that any better for you?

Or, if you don't want your setup to be run twice, don't call it setup.
;)

    package MyApp;
    use Catalyst;

    __PACKAGE__->app_setup( @plugins );

    sub app_setup {
        my $self = shift;

        $self->setup( @_ );
    }

-- 
Bill Moseley
moseley at hank.org




More information about the Catalyst mailing list