use strict; use AppConfig qw(:argcount); # my usual AppConfig initialization my $temp_conf = AppConfig->new( { CREATE => 1, GLOBAL => { ARGCOUNT => ARGCOUNT_ONE, DEFAULT => "",}, } ); # ->define() some default values and set any options for them in this sub define_defaults(); # load in CLI args $temp_conf->args(); # parse conf file (path specified in CLI args, otherwise use default) $temp_conf->file( $temp_conf->config_file() ); #### # save the CLI args my @CLI = @ARGV; # load in CLI args, gets those useful ones like path right off the bat $temp_conf->args(); # parse conf file (path specified in CLI args, otherwise use default) $temp_conf->file( $temp_conf->config_file() ); # reinforce those CLI args! $temp_conf->args(\@CLI);