use NYSCUL::ConfAssist qw(getDbConn loadConfig); loadConfig("myconf.xml"); foo(); sub foo { my($db)=getDbConn("mydb"); . . . }