warnings
编译指示没有抱怨“NaN”和“nan”是非数字的,这让我有点惊讶(和害怕) 。
为什么不warnings
排放他们的习惯'Argument isn't numeric in addition (+)
?
测试用例
$ perl -Mstrict -wE 'say 0+$_ for qw/string NaN nan fail/;'
Argument "string" isn't numeric in addition (+) at -e line 1.
0
0
0
Argument "fail" isn't numeric in addition (+) at -e line 1.
0