Hi folks,
I've been trying to store a hash in a session variable, using
code like that appended below. Call me a doofus, but I can't
seem to get it to work. Can anybody tell me what I'm doing wrong?
Thanks,
I've been trying to store a hash in a session variable, using
code like that appended below. Call me a doofus, but I can't
seem to get it to work. Can anybody tell me what I'm doing wrong?
You have to store a reference to the hash, ie
$Session-{Stuff} = \%stuff;
not
$Session-{Stuff}
Brian,
How about using a hashref
$stuff = { a = '1', b = '2', c = '3' };
instead of a hash?
darren
Bryan K. Wright ([EMAIL PROTECTED]) wrote:
Hi folks,
I've been trying to store a hash in a session variable, using
code like that appended below. Call me a doofus, but I can't
You have to store a reference to the hash, ie
$Session-{Stuff} = \%stuff;
not
$Session-{Stuff} = %stuff;
\%stuff is not a reference to a hash, it's a reference to each key and
value in the hash. I don't think you'll ever have to use \ on arrays or
hashes. The only way to get a
How about using a hashref
$stuff = { a = '1', b = '2', c = '3' };
$Session-{Stuff} = $stuff;
instead of a hash?
According to the other person, that would fix your problem.
Personally, I know too litte of EmbPerl to be of more help.
btw,
$Session-{Stuff}{$i}
is the same as
David is right here... $Session-{Stuff} = \%stuff is your answer.
--Joshua
_
Joshua Chamas Chamas Enterprises Inc.
NodeWorks free web link monitoring Huntington Beach, CA USA
http://www.nodeworks.com