#!/usr/bin/perl use strict; use Data::Dumper; use Getopt::Long (); use constant GETOPT_OPTS => qw(auto_abbrev no_getopt_compat require_order bundling); use constant GETOPT_SPEC => ( 'call=s' , 'base=s' , 'list:s' , 'db=s@' , 'tag=s' , 'p=s%' ); sub getopts (\%) { my $opt = $_[0]; grep { s/^--?no-/--no/ } @ARGV; Getopt::Long::GetOptions( $opt, GETOPT_SPEC ); } sub main () { my %opt; getopts( %opt ); warn( Data::Dumper->Dump([\%opt],["*opt"]) ); } main(); __END__