|
|
| Just another Perl shrine | |
| PerlMonks |
(CGI::Vars) Re: Variable Variablesby mwp (Hermit) |
| on Dec 05, 2000 at 07:41 UTC ( #44927=note: print w/ replies, xml ) | Need Help?? |
|
Doing something like this is bad practice, for a variety of reasons. Mostly because if someone adds a form field that you did not prepare for, it might affect a different part of the script. For example, if someone added a form field called "key" your script would die because it would try to set $key to the form value, which is also the loop iterator. If you want to avoid calling $query->param() each and every time you want to access the form values, and I sympathize, you should try something like this:
...et cetera. See the CGI.pm manpage for more info about the Vars syntax. HTH'kaboo
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||