don't use eval!
Arthur Axel "fREW" Schmidt [Wed, 10 Jun 2009 18:05:53 +0000 (18:05 +0000)]
lib/DBIx/Class/Storage/DBI/ODBC.pm

index 09a7c6b..40d12aa 100644 (file)
@@ -11,9 +11,11 @@ sub _rebless {
     unless ( $@ ) {
         # Translate the backend name into a perl identifier
         $dbtype =~ s/\W/_/gi;
-        my $class = "DBIx::Class::Storage::DBI::ODBC::${dbtype}";
-        eval "require $class";
-        bless $self, $class unless $@;
+        my $subclass = "DBIx::Class::Storage::DBI::ODBC::${dbtype}";
+        if ($self->load_optional_class($subclass) && !$self->isa($subclass)) {
+            bless $self, $subclass;
+            $self->_rebless;
+        }
     }
 }