Next Tricks of the Wizards 141

Overloading Overview

        package MyClass;
        use overload '+' => \&myadd, 
                     '-' => \&mysubtract,
                     ... 
                     ;
        $obj1->mysubtract($x);


Next Copyright © 2003 M. J. Dominus