if ($name ){ #since undef and '' both evaluate to false #this should work only when string is defined and non-empty... #unless you're expecting someting like $name="0" which is false. #notice though that $name="00" is not false}
↧
Answer by Joseph for In Perl, how can I concisely check if a $variable is defined and contains a non zero length string?
↧