Reading from a file doesn't have the "false false" problem on reading a 0 or empty line because the value read includes the trailing "\n" so will never be empty. As for why "0\n" isn't treated as false, I don't know -- normally the trailing stuff in a string is silently ignored, but (experimenting...) it seems that a string that converts to a value of zero is still true if it has stuff after it other than spaces (and maybe other things -- not tested everything, but not \n so not whitespace in general). But it's still zero in an expression, so "0 " is false, "0 pigs" is true, and 0+"0 pigs" is false. It's one of those places where Perl does what you want, most of the time, but is hard to understand if you want complete details.