Hi All,

I'm using Apache::Session::DB_File to manage some sessions via a mod_perl2 
handler and Apache2. I'm running into difficulties trying to read stored data 
in the sessions db while writing a  cleanup cron job to remove old sessions. 
The following code snippet illustrates the problem:

use strict;
use warnings;
use Fcntl;

use MLDBM qw(DB_File Storable);

use Data::Dumper;

tie my %sessions, "MLDBM", './sessions.db', O_RDWR|O_CREAT, 0666 or die $!;

(tied %sessions)->DumpMeth('portable'); # use Storable::nfreeze

my @keys = map { print "$_\n"; $_; } (keys %sessions);

print Dumper( \%sessions);

untie %sessions;

I am unable to read the stored data when I run the above code. I get the 
following output -- two session keys (OK) and mysterious error message when I 
try to dump out a session:

>perl cleanup.pl
e7324413d95fe51f1ac7e74a89b17b47
f72ec1ed349c7140e9f37087e04cd703
Not a SCALAR reference at 
/usr/local/lib/perl5/site_perl/5.8.8/MLDBM/Serializer/Storable.pm line 28.

I inspected both MLDBM and Apache::Session::DB_File and it looks to me like 
they both use Storable::thaw to unserialize the data. Any ideas why I am 
getting this message?

-James



IMPORTANT NOTICE REGARDING THIS ELECTRONIC MESSAGE:

This message is intended for the use of the person to whom it is addressed and 
may contain information that is privileged, confidential, and protected from 
disclosure under applicable law. If you are not the intended recipient, your 
use of this message for any purpose is strictly prohibited. If you have 
received this communication in error, please delete the message and notify the 
sender so that we may correct our records.

Reply via email to