in reply to Problem w/overloading and Carp::confess
The solution here is to detect when that's happened and return a static string, rather than calling confess again. Here's an example:
sub asString { return __PACKAGE__ if (caller)[1] =~ /Carp/; confess; }
That nicely breaks the recursion. Discovering why Carp is trying to stringify your object is left as an exercise for the reader. ;)
Cheers,
Paul
|
|---|