in reply to Re: Mixing OR with conditional operator
in thread Mixing OR with conditional operator

Choroba,

I have variables in my real code, I just thought I would simplify it as much as possible.

Actually I first wrote an example just like your last example. But I didn't think my 'simplification' would actually change the whole behavior!

OT: The current "Voting Booth"-question "In order to be able to say "I know Perl", you must have:", with the leading answer "One can never truly know perl", are totally correct ;-)

Edit: And yes, your last one liner code-example, fixes the issue and I will adopt that syntax!

Thank you!

-----BEGIN PERL GEEK CODE BLOCK----- Version: 0.01 P++>*$c--->---P6 > R >++++$M+>+++$O+++>+++$MA->+++$E > PU->++BD->-C+>+$D+>+$S->+++X >+WP >+++MO!PP n?CO--PO!>!(!)o?G!A--OLC--OLCC--OLJ--Ee !Ev-Eon-uL++>*uB!uS!uH-uo!w->!m+ ------END PERL GEEK CODE BLOCK------
  • Comment on Re^2: Mixing OR with conditional operator

Replies are listed 'Best First'.
Re^3: Mixing OR with conditional operator
by LanX (Saint) on Nov 19, 2017 at 12:41 UTC
    > One can never truly know perl

    This problem is not Perl specific, you need to respect precedence in all languages.*

    Just try to do the same expression in JS or C ...

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

    update

    *) correction, most not all. You might enjoy Lisp or Assembler.