Always use warnings, especially on one-liners.
Perl has no true or false named constants, and without warnings or strict enabled, a "bareword" (something that could be a constant or function but isn't) is silently interpreted as a string. So you are doing if("true") and if("false"), and all strings other than "" or "0" are true.