http://www.perlmonks.org?node_id=496032


in reply to True or False? A Quick Reference Guide

It's worth mentioning this tidbit I picked up from HOP: '0 but true' is a special-case that will not issue a warning when used in a numeric context.

$ perl -we 'print "0 but true" + 2' 2 $ perl -we 'print "0 but actually true" + 2' Argument "0 but actually true" isn't numeric in addition (+) at -e lin +e 1. 2

-xdg

Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.