Attribute-Overload

 view release on metacpan or  search on metacpan

t/01_all.t  view on Meta::CPAN

use warnings;
use strict;
use Attribute::Overload;
use Test::More tests => 3;

package MyOverload;

sub new {
    my ($class, $value) = @_;
    bless \$value => $class;
}

sub add : Overload(+) {
    my ($self, $value) = @_;
    $$self += 2 * $value;
    return $self;
}

sub cmpnum : Overload(==) {
    my $self = shift;

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.029 second using v1.00-cache-1.14-grep-28634ff-cpan-207214f8fbd )