All to often I find myself struggling with the way Perl treats 0 as a character/string
I find that when I have a string that is just "0" instead of using:
if($string)I need to use
if (defined($string)) or if(length($string))
And no matter how many times I do data file processing where '0' is a valid entry, I always have to come back and put in one of those fixes to properly deal with the '0'
am I an idiot or is this a common issue that I should be handling differently?
In reply to methods for dealing with zero '0' as a string or char by boleary
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |