When using overloaded operators in packages, the debugger generates a fatal error like:
Operation """": no method found, argument in overloaded package test at ...\ptkdb-with-overload.pl line 40.
I tooks like it has to do with access to "$theRef" in Devel::ptkdb::insertExpr. The workaround I found was to add the overloaded operator '""' as use overload '""' => sub { ref shift; };.
Unfortunate in my larger program I still got some unexpected calls to my overloaded function (not triggered by my code execution). I safegarded those methods with return if( ref $_[0] ne ref $_[1] ), but that is getting a problem when one a 'class' hierarchy.
Please run the attached program with perl -d:ptkdb ptkdb-with-overload.pl and note it will break at line 40. Uncomment line 31 to let it run stable. The error is repored at the source line. In my more complex program the error was reported from ptkdb.pm:
Operation """": no method found, argument in overloaded package XMLPlan at C:/Tools64/Perl64/lib/Devel/ptkdb.pm line 2604, <> line 2080.
Tested with
Activestate perl 64 bit, v5.24.3
, Tk v804.033
, Devel::ptkdb v 1.1091
There is a simple solution to solve this problem :
add to the overload definition the 'nomethod' item like this
use overload nomethod => sub {return $_[0]};