Pearte has asked for the wisdom of the Perl Monks concerning the following question:
This works as expected except where $cgi_query->param() returns undef, then a key's value becomes the subsequent key. (IE: If, in this case, $cgi->param('user_email') was returning undef, then $data{'email'} would have a value of 'name'). Can anyone explain this and/or suggest a better method?$cgi = new CGI; ... do stuff ... my %data; = ( 'email'=>$cgi->param('user_email'), 'name'=>$cgi->param('user_name'), 'cell_phone'=>$cgi->param('user_cell_phone'), 'home_phone'=>$cgi->param('user_home_phone'), 'work_phone'=>$cgi->param('user_work_phone'), );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unexpected Hash Assignment using cgi->params
by Errto (Vicar) on Nov 29, 2005 at 06:04 UTC | |
|
Re: Unexpected Hash Assignment using cgi->params
by kulls (Hermit) on Nov 29, 2005 at 06:15 UTC | |
|
Re: Unexpected Hash Assignment using cgi->params
by Zaxo (Archbishop) on Nov 29, 2005 at 06:23 UTC |