![]() |
|
Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^2: What's the point of this 'overload' idiom?by stevieb (Canon) |
on Dec 07, 2022 at 05:13 UTC ( #11148640=note: print w/replies, xml ) | Need Help?? |
Overloading as a general concept is something you want very rarely, but is very useful when you do want it. I really like that statement. Well put. One area where overloading is highly desired is during unit testing. Although I'd classify it as 'overwriting' rather than overloading, the premise is the same. Make a function do something different than what the original does. For example, Mock::Sub does exactly this. Overriding functions during testing happens very often and is hugely useful.
In Section
Seekers of Perl Wisdom
|
|