I
ioneabu
I am trying to restore values from a saved session to fill in my CGI.pm
fields in the simplest and most generic way possible (such that if I
change my form, I don't have to rewrite this code). This statement did
not work:
$params->{keys %session} = values %session;
$params is a reference to a tied hash returned by Vars().
Here is info on Vars() quoted from
http://stein.cshl.org/WWW/software/CGI/
<quote>
Many people want to fetch the entire parameter list as a hash in which
the keys are the names of the CGI parameters, and the values are the
parameters' values. The Vars() method does this. Called in a scalar
context, it returns the parameter list as a tied hash reference.
Changing a key changes the value of the parameter in the underlying CGI
parameter list. Called in an list context, it returns the parameter
list as an ordinary hash. This allows you to read the contents of the
parameter list, but not to change it.
</quote>
Thanks for help. I know I could do it differently, I was just
wondering why it didn't work this way.
wana
fields in the simplest and most generic way possible (such that if I
change my form, I don't have to rewrite this code). This statement did
not work:
$params->{keys %session} = values %session;
$params is a reference to a tied hash returned by Vars().
Here is info on Vars() quoted from
http://stein.cshl.org/WWW/software/CGI/
<quote>
Many people want to fetch the entire parameter list as a hash in which
the keys are the names of the CGI parameters, and the values are the
parameters' values. The Vars() method does this. Called in a scalar
context, it returns the parameter list as a tied hash reference.
Changing a key changes the value of the parameter in the underlying CGI
parameter list. Called in an list context, it returns the parameter
list as an ordinary hash. This allows you to read the contents of the
parameter list, but not to change it.
</quote>
Thanks for help. I know I could do it differently, I was just
wondering why it didn't work this way.
wana