Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
print "Result: " . (0 == 1); # Result: print "Result: " . (1 == 1); # Result: 1
为什么 perl 输出一个空字符串作为假值而不是0?
0
因为在 Perl 中,许多运算符和内置函数返回的 false 值是一个特殊值,在数字上下文中为 0,在字符串上下文中为 ''。