In cases where I don't care whether the variable is undef
or equal to ''
, I usually summarize it as:
$name = "" unless defined $name;if($name ne '') { # do something with $name}
In cases where I don't care whether the variable is undef
or equal to ''
, I usually summarize it as:
$name = "" unless defined $name;if($name ne '') { # do something with $name}