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() ); } ...
In reply to Re: Home made operands
by Plankton
in thread Home made operands
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |