in reply to cgi problem
if ($a == $b) { print "equals\n"; }
Both pieces of code print out "equals", but at the same time, both complains that $a and $b are uninitialized. So we DOES observed some inconsistency.if ($a eq $b) { print "equals\n"; }
When you use this undef value in a number context, perl evaulates undef to 0, and in a string context, evaluates undef to "" (empty string).
When you say undef == undef, both undef's are 0's, so 0 == 0. When you say undef eq undef, both undef's are "", so "" eq "".
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: cgi problem
by Anonymous Monk on Jan 04, 2003 at 04:50 UTC | |
by pg (Canon) on Jan 04, 2003 at 05:17 UTC |