package BaseClass::Log; @ISA = qw( BaseClass ); sub new { my $class = shift; my $self = $class->SUPER::new; my (%opt) = ( @_ ); $self->{opt} = \%opt; # Connect to the database. $self->{dbh} = $self->connect_db('hits') || return undef; return $self; }