in reply to Surprising Precedence/Context

As you can see below, the = binds tighter than the and, so your second example is parsing as:
(my($yes2)=defined $bad) and -f $bad;
Deparse:
[~]$ perl -MO=Deparse -e 'my($yes2) = defined $bad and -f $bad;' -f $bad if my($yes2) = defined $bad; -e syntax OK

Replies are listed 'Best First'.
Re^2: Surprising Precedence/Context
by Anonymous Monk on Jun 02, 2017 at 18:46 UTC
    When looking at precedence issues, the -p (full parens) Deparse option is helpful.
    > perl -MO=Deparse,-p -e 'my($yes2) = defined $bad and -f $bad;' ((my($yes2) = defined($bad)) and (-f $bad));
Re^2: Surprising Precedence/Context
by williams (Beadle) on Jun 02, 2017 at 19:04 UTC

    Ouch. Thanks.

    Jim