my $dbh = My::DB->new({server => 'foo', db => 'oops.db'}) #### if ($data->{server} eq 'pg') { ... } elsif ($data->{server} eq 'sqlite') { ... } else { Carp::croak "Oops, you tried to access a '$data->{server}' type database, but I have no idea what that is"; }