in reply to question about getopt

perldoc -f defined

Ieturns a Boolean value telling whether EXPR has a value other than the undefined value undef. If EXPR is not present, $_ will be checked.