# declare all aribles used by arguments or config files soon, specifying their default values: my $arg_color = 'red'; my $arg_limit = 1024; my $arg_config; # use Getopt::Long to parse command line arguments: die if this goes bad GetOptions( 'color=s' => \$arg_color, 'limit=i' => \$arg_limit , 'configuration => \$arg_config, ) or pod2usage(-verbose => 1) && exit; # apply eventual configuration if ($arg_config){ # warn about option that be ovveride and import the configuration ... } # check that all options are valid warning which one is incorrect, return false and die &check_config or die "Options are invalid";