Overloaded operators: Difference between revisions

Line 284:
See 'perldoc overload' for perl's overload capabilities. This example defines a class(package)
that represent non-negative numbers as a string of 1's and overloads the basic math operators
so that they can be used on members of that class(package). Also see 'Zeckendorf arithmetic' where overloading
is used on Zeckendorf numbers.
<lang perl>#!/usr/bin/perl
 
Anonymous user