in reply to Home made operands
Does use overload sound like what you are looking for? As in ...
But these would be homemade operators ;)... use overload "-" => \&minus, "+" => \&plus, "*" => \&mult, "bool" => \&bool; ... sub plus { my $u = shift; my $v = shift; return new Vector2D ( $u->getx() + $v->getx(), $u->gety() + $v->gety() ); } ...
|
|---|