for ($pname, $policy_ur, $odate) { if (!defined($_)) { $_ = ''; } } if ($pname ne '' && $policy_ur ne '' && $odate ne '') { ... }