Just because there are a lot of mundane situations that can lead to problems, doesn't mean that you in particular have recently run into any of them, of course.
But my point was that a lot of average Perl coders who decide to copy the "not length" usage can easily end up introducing bugs in several different quite mundane ways. And that pointing this out might encourage some to do the research to figure out why or, if already aware, to just be reminded to take care.
'or' and (to a lesser extent) 'not' and 'and' were designed for use as flow control and work well for that (at least for those who don't mind such idioms). You can certainly bend them to the purpose of simple boolean expressions, but the required bending is somewhat subtle, is not needed in many situations, and can often lead to errors that are only triggered in relatively rare "edge cases". I find this makes the risk unacceptably high of real bugs making it all of the way into Production if one starts frequently using 'not' for boolean expressions.
And when I got around to looking, I quickly found that my suspicions were confirmed and more than once, even for code from our best Perl coder. So I'm less shy about pointing this out, now.
Clearly, you are much better than any of our Perl coders. But a few people read this web site despite only being better than some of our Perl coders. q-:
- tye
In reply to Re^6: Undefined vs empty string (so much not)
by tye
in thread Undefined vs empty string
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |