Restore ability to handle underdefined root (t/prefetch/incomplete.t)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Carp.pm
index 6bec374..443e6ca 100644 (file)
@@ -1,4 +1,5 @@
-package DBIx::Class::Carp;
+package # hide from pause
+  DBIx::Class::Carp;
 
 use strict;
 use warnings;
@@ -81,10 +82,10 @@ sub import {
     );
   };
 
-  my $fired;
+  my $fired = {};
   *{"${into}::carp_once"} = sub {
-    return if $fired;
-    $fired = 1;
+    return if $fired->{$_[0]};
+    $fired->{$_[0]} = 1;
 
     $warn->(
       __find_caller($skip_pattern, $into),
@@ -114,7 +115,7 @@ sub import {
     ## FIXME FIXME FIXME - something is tripping up V::M on 5.8.1, leading
     # to segfaults. When n::c/B::H::EndOfScope is rewritten in terms of tie()
     # see if this starts working
-    unless DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN();
+    unless DBIx::Class::_ENV_::BROKEN_NAMESPACE_CLEAN;
 }
 
 sub unimport {