As already said Getopt does not return a hash. It also does not return whether the 'options were valid'.
It 'parses the command line arguments that are present in @ARGV and sets the option variable to the value 1 if the option did occur on the command line. Otherwise, the option variable is not touched.'
Good Luck!