I want to know the reason why I have to use defined when I need to know whether a variable is defined instead of using direct comparison with undef. For example this code isn't work as I expected ...output: $number is defined
Why do you expect the wrong thing? Where do you get your perl information from? Where did you learn that "" is the same as undef?
"" is never undef, its ""
In reply to Re: why can't compare a variable with undef directly?
by Anonymous Monk
in thread why can't compare a variable with undef directly?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |