in reply to Re: A set of new operators. In keeping with the design of Perl?
in thread A set of new operators. In keeping with the design of Perl?

I disagree - I think you need to evaluate the conditional once in scalar or list context, as appropriate, and then evaluate that result in a boolean context. Which implies that if the conditional involves an expensive operation, that operation need only be invoked once.

Of course, people that write clever stuff would need such behaviour documented, but that'd be true whichever approach were selected. And with the entire grammar so mutable, chances are a couple of extra lines in the docs could even show how to avoid this behaviour.

Hugo

  • Comment on Re: Re: A set of new operators. In keeping with the design of Perl?