my $common = common_class->new(); my $parser = parser_class->new(); ### this is the ugly part $parser->{ 'getDBH' } = \&$common->getDBH;