Because you do not test if the variable is defined but if it is true or false (0, undef, "").
Maybe you had something like this in mind?
sub isDef { return (defined shift) ? 'true' : 'false'; }
In reply to Re: Validation: is defined whether the variable?
by Perlbotics
in thread Validation: is defined whether the variable?
by breeze
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |