On Mon, Feb 8, 2010 at 6:19 PM, Uri Guttman <u...@stemsystems.com> wrote:

> >>>>> "7" == 7  <7stud.7s...@gmail.com> writes:
>
>  7> if (defined $var && ($var eq '' || $var eq '0')) {
>
>  7>     #code
>
>  7> }
>
>  7> to handle cases where $var = undef.  undef acts like it is a blank
>  7> string when used as a string.
>
> blah..
>
>        unless( $var ) {
>
> is all you need for that situation. you are already testing three of the
> four allowed false values. and the numeric 0 would be covered under the
> eq '0' test anyhow.
>
> newbies should be taught perl's boolean false values early on.
>


Because unless and until statements are harder to maintain, NO ONE should
use them--least of all beginners.

Reply via email to