# Setup the raw options from the system defaults. my $raw_opts; $raw_opts->{'help'} = sub{ pod2usage( -verbose => 0 ) }; $raw_opts->{'man'} = sub{ pod2usage( -verbose => 2, -exitstatus => 0 ) }; $raw_opts->{'verbose'} = sub{ $logger->more_logging(1) }; $raw_opts->{'quiet'} = sub{ $logger->level($FATAL) }; # Use the store in hash form op GetOptions, with references to exceptions setup above. GetOptions( $raw_opts, 'help|h', 'man', 'verbose+', 'quiet', 'username=s', 'password=s', 'password_file=s', # Other options. ) or pod2usage( -verbose => 0, -message => "incorect options" ); # Check the options. # Rest of the program.