On Thu, Jul 05, 2001 at 09:38:14AM +0100, Leon Brocard wrote:
> David Cantrell sent the following bits through the ether:
> 
> > Of course it is :-) and it's a pity perl doesn't let you overload
> > *everything*.

Getting (slightly) back to reality ...

perl currently lets you overload operators when you're dealing with blessed
objects.  That's how you can do maffs stuff with arbitrary precision numbers,
and how instances of some classes can stringify into sensible things.

I have frequently wanted to overload operators when not using objects -
for example, I wanted to overload == to tell me whether a list contained
a certain scalar - of course, now I can just do if($foo == any(@list))
but using Q::S makes my code much slower, and using it in production code
seems rather silly.

-- 
David Cantrell | [EMAIL PROTECTED] | http://www.cantrell.org.uk/david

             If a job's worth doing, it's worth dieing for

Reply via email to