Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: check for undefined param nameby CukiMnstr (Deacon) |
on Apr 02, 2002 at 21:40 UTC ( [id://156132]=note: print w/replies, xml ) | Need Help?? |
and I've also read that it will return a null '' but I haven't gotten that to work either.
a null '' is actually undef, it equals to false, so
would work, but
does not work... you might want to take a look at What is truth? here at the monastery for an explanation of "truth" in perl, as there are many 'gotchas' in handling truth in perl ;) (for example, in the code above, if 0 was a valid value for the loc parameter, the code would print the error message, even if we didn't want that.) hope this helps,
In Section
Seekers of Perl Wisdom
|
|