#called as Searchable->getTableHandler($table); sub getTableHandler { my $class = shift; my $table = shift; #get $handlerClass from db eval "use $handlerClass;"; #deal with errors return $handlerClass->new($table); }