I'm trying to use $r->pnotes to store a Class::DBI object in an early
stage handler so it may be retrieved by a later stage handler. Specifically:
in my PerlTransHandler:
my $dbrecord = ClassDBI_Table1->retrieve ( 1 ); # ClassDBI_Table1 is
of base Class::DBI::mysql
$r->pnotes('INFO_FOR_LATER', \$dbrecord );
Note that ClassDBI_Table1 represents a MySQL table that has a field
called "Name".
Then, in my PerlResponseHandler:
my $existing_dbrecord = $r->pnotes('INFO_FOR_LATER');
$r->log_error ( "INFO_FOR_LATER = " . $existing_dbrecord->Name );
Unfortunately, when I do this, I get a "Can't use an undefined value as a
HASH reference ..." error. I've tried various iterations of the code,
such as not deferencing the stored object in PerlTransHandler, as
well as referencing the Name property as $existing_dbrecord->{Name} (with
braces), but no luck. Have also tried assigning the pnotes value
as ('INFO_FOR_LATER' => \$dbrecord), but again not working.
Any help? Am guessing this is a syntax issue, but I'm not getting it.
FYI, am running Apache/2.0.48 (Unix) mod_perl/1.99_11 Perl/v5.8.2,
and I'm also using Apache::DBI.
thank you,
Eric
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html