Probably the safest way is to use a hash dispatch table. There are only a small number of possible hyphen-operators anyway. Another alternative would be to use the "quote" version of eval, but that just exposes you to too much potential for an eternity in outer darkness... so stick with a dispatch table.
Dave
In reply to Re: how to pass operators as arguments to a sub
by davido
in thread how to pass operators as arguments to a sub
by kurreburre
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |