> 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->{Stu
> 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 hash
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 c
> > 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 onl
> 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 a
> Er, I beg to differ. \%hash returns a reference to that hash -
> see the top of p.246 of the camel book, 2nd ed.
> The {} operators are for creating *anonymous* hashes.
I stand corrected. I was thinking of \($a, $b, $c). I always thought
\@array and \%hash worked the same way, so I never used
On Thu, 06 Jan 2000, Eric L. Brine wrote:
> > 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 ha
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