in reply to
what is *undef* ?
The only way to test if something is
undef
is to see if it's
not defined
:
if (not defined $x) { print "\$x is undef\n"; }
[download]
Using
undef
in numeric context (like you did) makes it look like 0; using it as a string makes it look like "".
japhy
--
Perl and Regex Hacker
Comment on
Re: what is *undef* ?
Download
Code
In Section
Seekers of Perl Wisdom