in reply to Why my variable is not 0 ?
Why "porter" is not 0 ?Why do you expect it to be 0? This is one way to get what you want:
Truth and Falsehooduse warnings; use strict; my $a = 6; my $porter = (($a & 1) != 0) ? 1 : 0; print "porter=$porter=\n"; __END__ porter=0=
|
|---|