|There's more than one way to do things|
Re: Check Variables for NULLby davorg (Chancellor)
|on Feb 08, 2007 at 09:16 UTC||Need Help??|
Perl tries to make things as easy as possible for you and this is a good example.
In most cases, what you actually want is as simple as:
(Note that the logic is reversed from your original example)
What we're doing here is checking the "truth" of $value. $value will be "false" if it contains any of the following values:
Any other value in $value will evaluate to "true".
This is all you need in most cases. There are a couple of "corner cases" that you sometimes have to consider:
"The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg