in reply to Re: How can I change the perl program involving if-elsif-else conditional to get correct result?
in thread How can I change the perl program involving if-elsif-else conditional to get correct result?

if($a>$b>$c) is not the way you should think, this is erronous
Though it may be "erronous" in Perl 5, I don't think it is erroneous in general. In fact, I think it is a sweet and natural syntax, aka "Chained Comparisons", and supported by both Perl 6 and Python.

  • Comment on Re^2: How can I change the perl program involving if-elsif-else conditional to get correct result?

Replies are listed 'Best First'.
Re^3: How can I change the perl program involving if-elsif-else conditional to get correct result?
by nemesdani (Friar) on Apr 23, 2012 at 11:34 UTC
    I omitted the "if you'd like to code correctly in Perl 5", yes, but I assumed that was the goal of the OP. :P "

    About chained comparisons: It's more natural than the current common practice, yes, but personally I don't find it nice. I never wrote a compiler, nor do I plan to, but I just don't think it's worth the trouble to implement it.

    Thank God, other people think otherwise, so in 2029 (my daughter graduates, Perl6 comes out) I'll be happy to get used to chained comparisons.

    I'm too lazy to be proud of being impatient.