[cgiapp] Re: order of operations

Ron Savage ron at savage.net.au
Wed Aug 12 18:50:30 EDT 2009


Hi Puneet

On Wed, 2009-08-12 at 12:07 -0500, P Kishor wrote:
> > 1. sub setup {
> >    my $self = shift;
> >    $self->SUPER::setup();
> >    $self->run_modes([qw( welcome view )]);
> >    $self->start_mode('welcome');
> >    $self->param(protected_runmodes => [qw(view)]);
> 
> 
> The above line re-declares the protected_runmodes param, so all the
> protected_runmodes set in MyAuthen vanish and we left with only 'view'
> as a protected_runmode. The following code corrects the situation
> 
> my $protected_runmodes = $self->param('protected_runmodes');
> push @$protected_runmodes, 'view';

All that does is store the run modes in an array local to the sub.

It does /not/ pass the updated list back to whatever object manages
these things.

-- 
Ron Savage
ron at savage.net.au
http://savage.net.au/index.html




More information about the cgiapp mailing list