Operator Overloading

B.22 Operator Overloading

You can redefine operators like addition, concatenation, comparison, or even the implicit string-to-number conversion with the overload module. This is how a module implementing complex numbers (for example) can let you multiply a complex number by 8 to get a complex number as a result.

 



Learning Perl
Learning Perl, 5th Edition
ISBN: 0596520107
EAN: 2147483647
Year: 2001
Pages: 205

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net