http://qs321.pair.com?node_id=813570


in reply to Hints Towards Writing a Module with New Operators

The little Fortran documentation that I can find by Googling suggests that, as moritz (implicitly) points out, .EQV. is just == on Booleans. If this is correct, are you just looking to bring to Perl the syntactic beauty of Fortran :-)—or is it that you want something that does the Boolean conversion for you, so that you can write $a .EQV. $b ** as the equivalent of $a ? $b ? 1 : 0 : $b ? 0 : 1 *?

Either way, as moritz says, for adding new syntax to Perl-as-it-now-is, I think that the only options are syntax filters (struck out as I write it so that you don't even think about it) or Devel::Declare (which worries adamk).

* Or ($a && $b) || !($a || $b), I suppose. UPDATE: Ha, and maybe I'd like to write my own routines for addition while I'm at it. Thanks, JavaFan. :-)

UPDATE: ** Note that this precise syntax conflicts with string concatenation, but we shouldn't be using barewords anyway.