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!
GetOptions() will return a true value if the command line could be processed successfully. Otherwise, it will write error messages to STDERR, and return a false result.