icius has asked for the wisdom of the Perl Monks concerning the following question:
My next thought is to iterate through the Params hash and use $$ to assign to variables like so:my %Params; if($Query->param) { %Params = $Query->Vars; }
Of course being a good boy and using strict this poses a problem as the new variables are not accessable outside of the while loop. I have been convinced of the evils of "::" from previous posts. So, anyone have any ideas?while (my ($key, $value) = each %Params) { my $$key = $value; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: CGI parameters as global variables
by jeffa (Bishop) on Jun 19, 2002 at 19:35 UTC | |
|
Moving CGI parameters to a hash
by jarich (Curate) on Jun 20, 2002 at 02:18 UTC | |
|
Re: CGI parameters as global variables
by boo_radley (Parson) on Jun 19, 2002 at 19:37 UTC | |
|
Re: CGI parameters as global variables
by Aristotle (Chancellor) on Jun 19, 2002 at 20:26 UTC | |
|
Re: CGI parameters as global variables
by shotgunefx (Parson) on Jun 19, 2002 at 19:28 UTC | |
|
Re: CGI parameters as global variables
by icius (Sexton) on Jun 19, 2002 at 20:25 UTC | |
by chromatic (Archbishop) on Jun 19, 2002 at 21:31 UTC | |
|
Re: CGI parameters as global variables
by George_Sherston (Vicar) on Jun 19, 2002 at 19:43 UTC |