in reply to Re^2: Confused by a couple of idioms
in thread Confused by a couple of idioms

slight problem I see here (for me at least) is the use of && in *nix, in conditional execution, e.g. ls abc && grep aaa abc. You mentioned that && may not do what one intends. Do you have an example where && does not do what intended? thanks, bliako

Replies are listed 'Best First'.
Re^4: Confused by a couple of idioms
by hippo (Archbishop) on Feb 22, 2019 at 11:50 UTC

    The higher precedence of && can be illustrated by the difference between these two:

    $ perl -E '$foo = 1 && $bar = 3; say $foo' 3 $ perl -E '$foo = 1 and $bar = 3; say $foo' 1

    This is why the word operators ( and or not ) should generally be used for control flow instead of the high-precedence symbolic operators ( && || ! ). HTH.

      got it thanks.