http://www.perlmonks.org?node_id=660225


in reply to Re: Adding a hash to a CGI param
in thread Adding a hash to a CGI param

Yes, that worked and I understand the 'concept'. Thanks. I think it might have been the hash reference that was throwing me. I suppose if I were storing an array in the param, I could push.


—Brad
"The important work of moving the world forward does not wait to be done by perfect men." George Eliot

Replies are listed 'Best First'.
Re^3: Adding a hash to a CGI param
by Anonymous Monk on Jan 03, 2008 at 17:10 UTC
    I suppose if I were storing an array in the param, I could push .

    Assuming that what was returned by  $self->param('foo') was an array reference and not a hash ref, you could indeed say:

    push @{ $self->param('foo') }, $element, $anotherelement, $etc;

    And, in general, treat the expression as you would any array ref:

    $self->param('foo')->[$n] = 42;