"be consistent" | |
PerlMonks |
Re: Overloading oddityby BrowserUk (Patriarch) |
on Jan 27, 2004 at 22:33 UTC ( [id://324552]=note: print w/replies, xml ) | Need Help?? |
The problem is that your overload function does not take into account the differences when being called as a conventional method, and when it is called via the overloading. In the latter case, there is an extra 3rd parameter identifying the ordering of the operands for the operator. From the overload pod:
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"Think for yourself!" - Abigail Timing (and a little luck) are everything!
In Section
Seekers of Perl Wisdom
|
|