programming-examples/perl/_Basics/Precedence with word operators and short-circuit operators.pl

13 lines
275 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
$x=5;
$y=6;
$z=0;
$result=$x && $y && $z; # Precedence of = lower than &&
print "Result: $result\n";
$result2 = $x and $y and $z; # Precedence of = higher than and
print "Result: $result2\n";
$result3 = ( $x and $y and $z );
print "Result: $result3\n";