On Tuesday 15 May 2007 2:50 pm, Dave Rolsky wrote:
> If the object has overloading, we want to use overload::StrVal instead of
> risking letting the object's stringification overloading kick in. That
> _is_ the problem you're seeing, somehow the overloading kicks in and
> throws an exception.

In the interest of explaining this, I investigated a little more, and I 
thought I'd report it in case anyone cares to know.

I used Devel::Peek to examine the CDBI object before and after deletion, and I 
think I understand now. The CDBI delete method, after deleting the object's 
data from the DB, does this to the object's reference:

        undef %$self;
        bless $self, 'Class::DBI::Object::Has::Been::Deleted';

So although the underlying hash gets undef'ed, the reference is still intact, 
with its internal OVERLOAD flag still set.  But since it's now blessed into a 
different (nonexistent) class, there's no overloaded operator hash, and the 
stringify fails.

I discovered that this bogus object also causes overload::StrVal to fail in 
overload 1.01 (perl 5.8.5).  In overload 1.03 (perl 5.8.7) the StrVal method 
is written differently and doesn't fail.

Again, thanks for the help.

-Charlie

-- 
Charlie Katz
Harvard-Smithsonian Center for Astrophysics
[EMAIL PROTECTED]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to