B
Bill H
In a script I have on a site I read all the values passed in the url
(using the GET method) into an array called $query{'foo'} where foo is
the name of the value. Though this has always worked fine I find
myself assigning them to a new variable to make it easier to recognize
them and quicker to type, for example I'll make $foo = $query{'foo'};
The question is, is there anything wrong with doing the following to
automate this process, or is there a better "perl" way of doing the
same?
foreach $temp (keys(%query))
{
eval("\$$temp = \$query{\$temp};");
}
Bill H
(using the GET method) into an array called $query{'foo'} where foo is
the name of the value. Though this has always worked fine I find
myself assigning them to a new variable to make it easier to recognize
them and quicker to type, for example I'll make $foo = $query{'foo'};
The question is, is there anything wrong with doing the following to
automate this process, or is there a better "perl" way of doing the
same?
foreach $temp (keys(%query))
{
eval("\$$temp = \$query{\$temp};");
}
Bill H