in reply to how to self define a operator
What you want to do would require modifying the language with new syntax. Hopefully needless to say, such endeavors are difficult, dangerous, and likely to be a waste of time, even if you are already a language specialist. To wit, the ~~ (smartmatch) binary operator was added to a public release almost 12 years ago, and it's still not stable.
You might be able to hack something together with source filters that sort of works in limited cases, but please don't. Odds of something like that breaking in simultaneously spectacular and sneaky fashion are unacceptably high for anything other than toy programs.
Would you mind sharing more details on what you are actually trying to accomplish (apart from inventing syntax)? A proper description of what you are actually working on would help us help you. There may well be an easy, elegant solution in pure Perl.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to self define a operator
by toothedsword (Sexton) on Oct 22, 2019 at 07:49 UTC |