in reply to Re: strange boolean algebra behaviour
in thread strange boolean algebra behaviour
This gives me warning that "Useless use of private variable in void context at tmp16.pl line 6.". line 6 is "my $c = $a and $b;". I first tried -MO=Deparse.use strict; use warnings; my $a = 1; my $b = 0; my $c = $a and $b; print "c=$c\n";
So, Deparse maybe says $b of "$b if my $c = $a;" is the useless use of private variable.C:\temp>perl -MO=Deparse tmp16.pl Useless use of private variable in void context at tmp16.pl line 6. use warnings; use strict 'refs'; my $a = 1; my $b = 0; $b if my $c = $a; print "c=$c\n"; $a = 1; $b = 0; $c = $a && $b; print "c=$c\n"; tmp16.pl syntax OK
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: strange boolean algebra behaviour
by Anonymous Monk on Apr 05, 2012 at 06:54 UTC | |
by remiah (Hermit) on Apr 05, 2012 at 15:21 UTC |