in reply to Home made operands
Operands are arguments to operators. You can take any variable, constant or object you want and pass it to any operator you want.
With overload you can give existing operators new meaning for some objects as operands.
In Perl 6, you can make new operators simply by declaring them:
sub postfix:<!>(Int $n) { [*] 1..$n } say 6!; # 120
In Perl 5, there is no simple way. Filter::Simple and other source filters require much more work to declare new operators, and the result is generally rather brittle.
Devel::Declare makes creating new syntax a bit more robust, but it's just a gradual improvement.
|
|---|