if (!defined $pname) { do something with $pname } else { do something in the way of a polite error message }