in reply to Re: defined vs null string
in thread defined vs null string
This makes sense. It is technically redundant: 'undef' evaluates to the empty string in string context, so undef ne "" is false. However, evaluating undef in a string context gives you a warning if use warnings is turned on, so what you wrote is the proper thing to do.if (defined $p && $p ne "") { # To see if $p had non-null value # Do something }
|
|---|