On Tue, 5 Jun 2001, Hasanuddin Tamir <[EMAIL PROTECTED]> wrote,
> Date: Tue, 5 Jun 2001 01:22:59 +0700 (JAVT)
<snip>
> Take a look at these one-liner examples. The string "(nothing)" indicates
> that no output is printed.
>
> 1% perl -le '$x; print 1 if $x ne ""'
> (nothing)
>
> 2% perl -le '$x = undef; print 1 if $x ne ""'
> (nothing)
<snip>
> Undefined value is not the same as empty string (""), but both are
> evaluated to false. If you use undefined variable anyway, it will be
> evaluated to empty (see no.5 and 6). Empty field is sent as undefined
> value and when you test it against "" with 'ne' operator, it evaluates to
> true because they're not equal.
Wait a minute. I have my head dazzle reading my own posting.
Both 1 and 2 print nothing because undef and "" are indeed equal.
I'm sorry, I'll be more careful before posting.
<snip>
s.a.n
--
Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com