-1
我有没有操作测试两个perl的代码,但看起来像它给人两种不同的结果,即在Perl不操作犯规给出相同结果的两个代码
$a = 1;
print "the value of a is $a\n";
$a = $a - 1;
$b = not $a;
print "value of b is $b\n";
当我运行上面的代码,我得到
the value of a is 1
value of b is 1
但是当我修改上面的代码下面
$a = 1;
print "the value of a is $a\n";
#$a = $a - 1;
$b = not $a--;
print "value of b is $b\n";
我得到以下结果
the value of a is 1
value of b is
应该在第一代码不not($a)
相同第二码not($a--)
?
谢谢,@米勒 – ysth 2014-09-18 23:42:43