Re: Storing hashes in Apache::ASP

2000-01-06 Thread David Mitchell
> 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

Re: Storing hashes in Apache::ASP

2000-01-06 Thread Eric L. Brine
> 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

Re: Storing hashes in Apache::ASP

2000-01-06 Thread darren chamberlain
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

Re: Storing hashes in Apache::ASP

2000-01-06 Thread David Mitchell
> > 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

Re: Storing hashes in Apache::ASP

2000-01-06 Thread Eric L. Brine
> 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

Re: Storing hashes in Apache::ASP

2000-01-06 Thread Eric L. Brine
> 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

Re: Storing hashes in Apache::ASP

2000-01-06 Thread Matt Sergeant
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

Re: Storing hashes in Apache::ASP

2000-01-06 Thread Joshua Chamas
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