On Monday 14 May 2007 3:08 pm, Dave Rolsky wrote: > The changes to avoid overloaded stringification were introduced much > earlier than 1.13. > > Devel::StackTrace can be forced to respect stringication overloading, but > that's not the default, so I'm not sure why you're seeing this particular > problem. > > Can you come up with a simple example outside of Mason?
I can try that (I'll look at Sherrard Burton's example as a guide). Meanwhile I've been chasing the problem deeper, and I think have found the spot where the problem is happening. Here's my (quite possibly incorrect) understanding: 1) my component has an object ($event) in its <%args> which after the CDBI delete, gets reblessed into a dummy class "Class::DBI::Object::Has::Been::Deleted" 2) the component calls $m->redirect, which Mason handles as an exception, leading to Exception::Class::Base->throw being called 3) throw() calls die, which causes Devel::StackTrace to be called to create a stack trace The problem occurring in Devel::StackTrace, in _ref_as_string. I put some debugging statements in there. sub _ref_as_string { my $self = shift; local $@; # some print STDERR statements here to examine the values used in the # if() test if ( ref $_[0] && ! $self->{respect_overload} && eval { overload::Overloaded($_[0]) } ) { return overload::StrVal($_[0]); } else { # force stringification $_[0] . ''; } } When this runs for the dummy class, the else clause is taken. The dummy object looks like bless {}, 'Class::DBI::Object::Has::Been::Deleted'; and that's it. So in the if() test, I find from my diagnostic print statements, ref $_[0] is TRUE $self->{respect_overload} is FALSE eval { overload::Overloaded($_[0]) } is FALSE that last one, because the dummy object isn't overloaded, makes the if() test fail, so the else clause is taken, where the object stringification fails. For this case at least, it appears that the if() logic is wrong: shouldn't the eval { overload::Overloaded($_[0]) } test be !eval{ ... } ? If the object doesn't have any overloading, the code shouldn't try to force stringification, should it? I'm must not be understanding how Devel::StackTrace works. Would it still be helpful for me to try to put together a simple test case? I think it's going to look more or less like this: use Devel::StackTrace; my $obj = {}; bless $obj, 'This::Class::Does::Not::Exist'; sub dumpstack { my $obj = shift; my $tr = Devel::StackTrace->new; print $tr->as_string; } dumpstack($obj); which, when run, gives % st.pl Trace begun at st.pl line 12 main::dumpstack('This::Class::Does::Not::Exist=HASH(0x814bc28)') called at st.pl line 17 -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