in reply to connect_with_option_file

you can use Config::Find to find the configuration file, it will look in all the common places for it, for instance...
use Config::Find; my $cfg_fn = Config::Find->new(name=>'foo');
will look for it on
~/.foo ~/.foo.conf ~/.foo.cfg $FOO_HOME/etc/foo.conf $FOO_HOME/etc/foo.cfg /etc/foo.conf /etc/foo.cfg