in reply to Re^3: Use of uninitialized value??
in thread Use of uninitialized value??
as you are testing not only that the value is defined, but that the value is also not zero or an empty string. As a general practice, you should be writing:if ($variable and $variable eq 'value') { # do something # ... }
if ((defined $variable) && ($variable eq 'value')) { # do something # ... }
|
|---|