if (defined $p && $p ne "") { # To see if $p had non-null value # Do something }