if (!defined $id) { # Deal with id } else { # Deal with not undef id }