Only just noticed this line of your comment:
I think it doesn't, since I need most operators already. :/
Not sure what you mean by it. Did you assume that using Sub::Infix takes over existing operators, so you can no longer use (for example) the | or / operators normally? Because that's not what it does. You can continue to use the existing Perl operators normally, with no slow down, but Sub::Infix will allow you to define additional operators like:
use Sub::Infix; BEGIN { *between = infix { my ($number, $range) = @_: $number >= $range->[0] and $number <= $range->[1]; }; } if ($value <<between>> [1,10]) { ...; }
The only limitation is that your infix operator can't be spelled just between. It needs to be |between|, /between/, or <<between>> (and depending on which you choose, you'll get different precedence).
In reply to Re^3: Implementing named infix operators with parser hook?
by tobyink
in thread Implementing named infix operators with parser hook?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |