Jeff Abrahamson on Fri, 26 Jul 2002 11:54:19 -0400 |
On Fri, Jul 26, 2002 at 10:55:32AM -0400, Eric Roode wrote: > If anyone can shed some light on this, I'd be grateful. TIA. > > I have a class, DBdate. It overloads no operators. I can go into the > debugger, create a new object ("$a = new DBdate('2002-07-26')"), and > examine the object ("x $a"). Fine. > > Now I edit the module file DBdate.pm. I add the following lines, no > others: > > use overload '>' => '_gt', > '>=' => '_ge', > '<' => '_lt', > '<=' => '_le', > '<=>' => '_cmp', > '==' => '_eq', > '!=' => '_ne'; > > (Those subroutines already exist in the file). Now I go into the > debugger, create a new object the same way, and try to examine it. > I get: > > Operation `""': no method found, argument in overloaded package DBdate > at /usr/local/lib/perl5/5.6.1/overload.pm line 92. > > WTH? I'm not attempting to overload '""'. I can't believe that > overloaded objects can't be examined in the debugger...?? > > What am I missing? I believe you have to point to references to functions, not strings: use overload '>' => \&_gt, '>=' => \&_ge, '<' => \&_lt, '<=' => \&_le, '<=>' => \&_cmp, '==' => \&_eq, '!=' => \&_ne; -- Jeff Jeff Abrahamson <http://www.purple.com/jeff/> The Big Book of Misunderstanding, now in bookstores and on the web: <http://www.misunderstanding.net/buystuff.html> **Majordomo list services provided by PANIX <URL:http://www.panix.com>** **To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**
|
|