From: Arthur Axel "fREW" Schmidt Date: Wed, 10 Jun 2009 18:05:53 +0000 (+0000) Subject: don't use eval! X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4a9a13c8eb382398293df0c3a6c8652ee4a18db1;p=dbsrgits%2FDBIx-Class-Historic.git don't use eval! --- diff --git a/lib/DBIx/Class/Storage/DBI/ODBC.pm b/lib/DBIx/Class/Storage/DBI/ODBC.pm index 09a7c6b..40d12aa 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC.pm @@ -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; + } } }