package my_package; use Class::DBI::Loader; use XML::Simple; | much handwaving... sub new { | more handwaving... my $config = new XMLIn(); $self->{loader} = Class::DBI::Loader -> new ( dsn => sprintf("dbi:%s:dbname=%s;host=%s", $config->{disco_database}->{driver}, $config->{disco_database]->{dbname}, $config->{disco_database}->{host}), user=>$config->{disco_database}->{user}, password=>$config->{disco_database}->{password} | and so forth...