The number 0, the strings '0' and '' , the empty list () , and undef are all false in a boolean context. All other values are true. Negation of a true value by ! or not returns a special false value. When evaluated as a string it is treated as '' , but as a number, it is treated as 0.

Which stems from the curious fact that a Perl scalar internally has a slot for both a numeric and a string value. By explicitly providing a numeric value, you don't get a warning when used as a number:

That refcount (2147483647) looks strangely familiar. Is that a coincidence or just a hack in the interpreter so it (the object in question) never gets destroyed by the garbage collector (theoretically)?

So I looked at the code to answer your question. It looks like it's a hack, not a magical value. The refcount can go down, but it gets reset back to the max for SvIMMORTAL variables (the true, the false, the undef and a special internal thing called "placeholder").