From: Peter Rabbitson Date: Tue, 31 Aug 2010 10:39:01 +0000 (+0200) Subject: Fix mysterious ::Storage::DBI goto-shim failures on older X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4cb6dfa2c82f4fece4945f15b040424e3b012252;p=dbsrgits%2FDBIx-Class-Historic.git Fix mysterious ::Storage::DBI goto-shim failures on older perl versions (tested on 5.8.1) --- diff --git a/Changes b/Changes index a20019f..8037e66 100644 --- a/Changes +++ b/Changes @@ -28,6 +28,8 @@ Revision history for DBIx::Class - Fixed SELECT ... FOR UPDATE with LIMIT regression (RT#58554) - Fixed CDBICompat to preserve order of column-group additions, so that test relying on the order of %{} will no longer fail + - Fixed mysterious ::Storage::DBI goto-shim failures on older + perl versions * Misc - Refactored capability handling in Storage::DBI, allows for diff --git a/lib/DBIx/Class/Storage/DBI.pm b/lib/DBIx/Class/Storage/DBI.pm index ef02092..e84f38d 100644 --- a/lib/DBIx/Class/Storage/DBI.pm +++ b/lib/DBIx/Class/Storage/DBI.pm @@ -93,7 +93,13 @@ for my $meth (@rdbms_specific_methods) { *{__PACKAGE__ ."::$meth"} = subname $meth => sub { if (not $_[0]->_driver_determined and not $_[0]->{_in_determine_driver}) { $_[0]->_determine_driver; - goto $_[0]->can($meth); + + # This for some reason crashes and burns on perl 5.8.1 + # IFF the method ends up throwing an exception + #goto $_[0]->can ($meth); + + my $cref = $_[0]->can ($meth); + goto $cref; } goto $orig; };