Eric Roode on Fri, 26 Jul 2002 13:27:42 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: The debugger and overloading


Jeff Abrahamson writes:
 > On Fri, Jul 26, 2002 at 10:55:32AM -0400, Eric Roode wrote:
 > > 
 > > use overload '>'   => '_gt',
 > >              '>='  => '_ge',
 > >              '<'   => '_lt',
 > >              '<='  => '_le',
 > >              '<=>' => '_cmp',
 > >              '=='  => '_eq',
 > >              '!='  => '_ne';
 > > 
 > 
 > I believe you have to point to references to functions, not strings:
 > 
 >     use overload '>'   => \&_gt,
 > 		 '>='  => \&_ge,
 > 		 '<'   => \&_lt,
 > 		 '<='  => \&_le,
 > 		 '<=>' => \&_cmp,
 > 		 '=='  => \&_eq,
 > 		 '!='  => \&_ne;

You don't have to; you can use strings, which is useful if any of the
functions are inherited (although none are inherited in my case).

I tried using code references as you suggest, but I got the same error.

========================================================================
Eric J. Roode                                              eric@myxa.com
Senior Software Engineer, Myxa Corporation               +1(610)234-2623
print scalar reverse sort qw p ekca lre reh 
ts uJ p, $/.r, map $_.$", qw e p h tona e;
**Majordomo list services provided by PANIX <URL:http://www.panix.com>**
**To Unsubscribe, send "unsubscribe phl" to majordomo@lists.pm.org**