in reply to Multiple CGI parameters
The great thing about 'use strict' is that when you know that it's being a problem, you can turn it off:
for $param (@params) { no strict 'refs'; $$param = $cgi->param($param); }
however, in your case, as everything's a scalar, I'd probably use the 'Vars' function to just dump it all to a hash: (or hashref, in this particular example)
use CGI ':cgi-lib'; $params = Vars;
Update: chromatic is completely correct. You shouldn't turn off strict unless you're sure it's a good idea, as it can get you into trouble. If you're going to use the above trick, @params should come from a list that you define, and not from a call to params() or anything that might be tainted.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multiple CGI parameters
by chromatic (Archbishop) on Aug 15, 2008 at 17:04 UTC | |
|
Re^2: Multiple CGI parameters
by sstevens (Scribe) on Aug 15, 2008 at 16:25 UTC | |
by FunkyMonk (Bishop) on Aug 15, 2008 at 22:59 UTC |