I would advice against using and in this context, because later someone (you) may add an innocent return ....
sub is_empty_string { my ($value) = @_; return defined $value and $value eq ''; }
I think && is more appropriate here:
sub is_empty_string { my ($value) = @_; return defined($value) && $value eq ''; }
In reply to Re^2: complaint: always testing defined()
by roman
in thread complaint: always testing defined()
by RaptorRex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |