Attribute::Overload - Attribute that makes overloading easier
version 1.100710
use Attribute::Overload; sub add : Overload(+) { # ... }
The Overload attribute, when used on a subroutine, declares that subroutine as the handler in the current package for the operation(s) indicated by the attribute options. Thus it frees you from the implementation details of how to declare overloads and keeps the definitions where they belong, with the operation handlers.
Overload
For details of which operations can be overloaded and what the overloading function gets passed see the overload manpage.
Note that you can't overload constants this way, since this has to happen during BEGIN time, but attributes are only evaluated at CHECK time, at least as far as Attribute::Handlers is concerned.
See perlmodinstall for information and options on installing Perl modules.
No bugs have been reported.
Please report any bugs or feature requests through the web interface at http://rt.cpan.org/Public/Dist/Display.html?Name=Attribute-Overload.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see http://search.cpan.org/dist/Attribute-Overload/.
The development version lives at http://github.com/hanekomu/Attribute-Overload/. Instead of sending patches, please fork this project using the standard git and github infrastructure.
Marcel Gruenauer <marcel@cpan.org>
This software is copyright (c) 2001 by Marcel Gruenauer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Attribute::Overload, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Attribute::Overload
CPAN shell
perl -MCPAN -e shell install Attribute::Overload
For more information on module installation, please visit the detailed CPAN module installation guide.