Thanks Jeffa. Believe me, I haven't forgotten about (jeffa) Re: A better mod (%) operator? and my reply at Re: (jeffa) Re: A better mod (%) operator? still stands. I've frequently used overload for individual and groups of math and boolean operators, probably because you gave me 'boost up' back then.
However, whenever I've tried to use it with the more esoteric operators, notably, '""' and '0+' (Thanks Zaxo) but also "{}", "[]", I've often found myself fighting the compiler to get the effects I want ... as opposed, perhaps, to the effects that overload is designed to give me.
I've read the overload docs so many times I almost know them verbatim, but I still get caught out every time I try to use it....as at Temporarily disabling overloaded operations..
Individually, I can make them work fine (mostly:), but when I try to use large scale overlaoding, especially in classes that are not simple classes, but (for example) use inheritance, or even tieing, things start going astray.
So, having looked around at a few complex uses like the Math::Big* suite, but found it difficult to follow as the are inherently complex beasties without the overloading, they also aren't pure perl, which makes it more difficult to trace stuff through in the debugger, I thought I'd ask if anyone knew of a fairly simple, but (more) complete worked example.
Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
| [reply] |