OP is checking for defined-ness solely to avoid generation of the warning (if the variable being checked against the empty string happens to be undefined). To me, that is whole reason for existence of this thread (from OP)...
I find myself doing:to avoid a runtime warning.if (defined($params->{root}) && $params->{root} eq '')
In reply to Re^3: complaint: always testing defined()
by parv
in thread complaint: always testing defined()
by RaptorRex
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |