Switch to a sane deduplication system
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / _Util.pm
index 35f8ad0..37dddfc 100644 (file)
@@ -29,6 +29,9 @@ BEGIN {
     File::Spec->catdir( (File::Spec->splitpath(__FILE__))[1], '_TempExtlib' )
   ) =~ /^(.*)$/; # screw you, taint mode
 
+  die "TempExtlib $HERE does not seem to exist - perhaps you need to run `perl Makefile.PL` in the DBIC checkout?\n"
+    unless -d $HERE;
+
   unshift @INC, $HERE;
 }
 
@@ -101,7 +104,7 @@ our @EXPORT_OK = qw(
   sigwarn_silencer modver_gt_or_eq
   fail_on_internal_wantarray fail_on_internal_call
   refdesc refcount hrefaddr is_exception
-  quote_sub qsub perlstring
+  quote_sub qsub perlstring serialize
   UNRESOLVABLE_CONDITION
 );
 
@@ -142,6 +145,12 @@ sub refcount ($) {
   B::svref_2object($_[0])->REFCNT;
 }
 
+sub serialize ($) {
+  require Storable;
+  local $Storable::canonical = 1;
+  Storable::nfreeze($_[0]);
+}
+
 sub is_exception ($) {
   my $e = $_[0];