I tried Perrin's suggestion, but got the same error message
(Can't call method "Name" on an undefined value at....)

On further investigation, the problem seems to be that the object
is losing its namespace.  In the first handler (where I define
the object and store it in pnotes) I'm logging the value of
"ref $dbrecord" and getting the correct Class::Object value.  In
the second handler (where I retrieve the object from pnotes
and try to access a method), I'm logging the "ref $dbrecord" and
getting a blank ("").  Seems that this must be the problem...
any other ideas?

thanks
Eric



> -----Original Message-----
> From: Perrin Harkins [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, December 18, 2003 9:22 PM
> To: Eric J. Hansen
> Cc: [EMAIL PROTECTED]
> Subject: Re: using pnotes to store/retrieve Class::DBI objects?
> 
> 
> Eric J. Hansen wrote:
> >     my $dbrecord = ClassDBI_Table1->retrieve ( 1 );         
> # ClassDBI_Table1 is of base Class::DBI::mysql
> >     $r->pnotes('INFO_FOR_LATER', \$dbrecord );
> 
> Should be
> 
> $r->pnotes('INFO_FOR_LATER', $dbrecord );
> 
> >     my $existing_dbrecord = $r->pnotes('INFO_FOR_LATER');
> >     $r->log_error ( "INFO_FOR_LATER = " . 
> $existing_dbrecord->Name );
> 
> Should be
> 
> $r->log_error ( "INFO_FOR_LATER = " . $existing_dbrecord->Name() );
> 
> > I've tried various iterations of the code
> 
> I'm guessing you just didn't try the right combination.
> 
> - Perrin


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to