Well... defined $kaka actually checks to see if $kaka is defined at ALL. something that is defined as zero, null, or empty is still defined.
sean@anticharm:~$ perl -e 'print "defined!\n" if defined $foo'
sean@anticharm:~$ perl -we '$foo = 0; print "defined!\n" if defined $f
+oo'
defined!
sean@anticharm:~$ perl -we '$foo = ""; print "defined!\n" if defined $
+foo'
defined!
As far as I am aware, once you define something you must use undef (or assign it the value of something undefined: undef $baz; $foo=$baz;) if you want it to be undefined again. |