develooper Front page | perl.perl5.porters | Postings from March 2020

Re: chained comparisons

Thread Previous | Thread Next
Zefram via perl5-porters
March 6, 2020 19:50
Re: chained comparisons
Message ID:
David Nicol wrote:
>does it short-circuit as soon as possible starting from the left, on
>failure? that is, when A is greater than B, C<<  A <= B <= C >> won't
>evaluate C?

Yes, it does short-circuit in that case, and won't evaluate C.

>also can the with and without equals versions (lt, le), (<, <=), (gt, ge),
>and (>, >=) chain together

Yes, all of those operators chain with each other.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About