in reply to Re: CGI::Application - alternative to using $self->param?
in thread CGI::Application - alternative to using $self->param?

Also, the ->param(...) method is read-only - you can't change values of parameters with it.

Sure you can. It works pretty much just like CGI's param method. This works fine:

$self->param( key => \%valuahash );

If you want a hash with all your params, you can get it like this:

sub some_run_mode { my $self = shift; # note that CGI.pm does the same thing: my @params = $self->param; my %hash = map { $_ => $self->param( $_ ) } @params; }

That would be a little tedious to do in every runmode, but you could do it in a prerun hook instead.

Replies are listed 'Best First'.
Re^3: CGI::Application - alternative to using $self->param?
by Anonymous Monk on Nov 21, 2007 at 01:10 UTC
    Thanks for pointing that out. Shortly after writing that I decided to check it out and re-edited my response accordingly.