package Foo::DBI; @Foo::DBI::ISA = qw( Class::DBI ); use Class::MethodMaker new_with_init => 'new'; sub init { my $self=shift; $self->set_db('Main', 'dbi:mysql:my_database', 'user', 'xxxx'); }