Cleanup that namespacing mess
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / TxnScopeGuard.pm
index 4365b9d..56c8c81 100644 (file)
@@ -6,23 +6,21 @@ use Carp::Clan qw/^DBIx::Class/;
 use Try::Tiny;
 use Scalar::Util qw/weaken blessed/;
 use DBIx::Class::Exception;
-use namespace::clean;
 
 # temporary until we fix the $@ issue in core
 # we also need a real appendable, stackable exception object
 # (coming soon)
 BEGIN {
-  if ($] < 5.013001) {
-    *IS_BROKEN_PERL = sub () { 0 };
-  }
-  elsif ($] < 5.013008) {
+  if ($] >= 5.013001 and $] <= 5.013007) {
     *IS_BROKEN_PERL = sub () { 1 };
   }
   else {
-    die 'The $@ debacle should have been resolved by now, adjust DBIC';
+    *IS_BROKEN_PERL = sub () { 0 };
   }
 }
 
+use namespace::clean;
+
 my ($guards_count, $compat_handler, $foreign_handler);
 
 sub new {
@@ -107,7 +105,7 @@ sub DESTROY {
   return if $dismiss;
 
   # if our dbh is not ours anymore, the weakref will go undef
-  $storage->_preserve_foreign_dbh;
+  $storage->_verify_pid;
   return unless $_[0]->[2];
 
   my $exception = $@;