in reply to Re^2: strange boolean algebra behaviour
in thread strange boolean algebra behaviour

-p

$ perl -MO=Deparse -e " my $foo = $bar and $baz; " $baz if my $foo = $bar; -e syntax OK $ perl -MO=Deparse,-p -e " my $foo = $bar and $baz; " ((my $foo = $bar) and $baz); -e syntax OK

Replies are listed 'Best First'.
Re^4: strange boolean algebra behaviour
by remiah (Hermit) on Apr 05, 2012 at 15:21 UTC
    When you use the -p option, the output also includes parentheses even when they are not required by precedence, which can make it easy to see if perl is parsing your expressions the way you intended.

    thank you. maybe easier to see.

    perl -MO=Deparse,-p -anle "print $F[3];" tmp.txt
    This showed me what is -a,n,l.