We are trying to store references in session variables but for some reason
this does not work. The reference cannot be regained.

For example, in simple Perl I can create an array containing two anonymous
hashes, then place a reference to this array in
$d, then dereference $d to recover the array.

@c[0]={'k1','v1','k2','v2'};
@c[1]={'k3','v3','k4','v4'};
$d=\@c;
print $$d[0]{'k1'},"\n";
@e=@$d;
print $e[0]{'k1'},"\n";

Using a session variable instead of $d allows the assignment but the session
variable cannot then be dereferenced successfully. The problem also occurs
with Apache::DBI database handles, which are some kind of hash reference.
These cannot be stored in session variables, either.

I assume there is some arcane Perl reason for this, but I lack the guru
skills to divine this. Is there any way to store non-scalar variables in
session variables?.

Reply via email to