From: Peter Rabbitson Date: Mon, 21 Jul 2014 07:57:24 +0000 (+0200) Subject: Replace B::perlstring with our own implmentation thereof X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=01b25f121c701218255c44a5037f1c57c8a00382;p=dbsrgits%2FDBIx-Class-Historic.git Replace B::perlstring with our own implmentation thereof Haarg++ for pointing this out --- diff --git a/lib/DBIx/Class/ResultSource/RowParser/Util.pm b/lib/DBIx/Class/ResultSource/RowParser/Util.pm index 6203efa..4a03a55 100644 --- a/lib/DBIx/Class/ResultSource/RowParser/Util.pm +++ b/lib/DBIx/Class/ResultSource/RowParser/Util.pm @@ -5,7 +5,7 @@ use strict; use warnings; use List::Util 'first'; -use B 'perlstring'; +use DBIx::Class::_Util 'perlstring'; use constant HAS_DOR => ( $] < 5.010 ? 0 : 1 ); diff --git a/lib/DBIx/Class/_Util.pm b/lib/DBIx/Class/_Util.pm index 5a35ab3..8c2ef12 100644 --- a/lib/DBIx/Class/_Util.pm +++ b/lib/DBIx/Class/_Util.pm @@ -60,6 +60,7 @@ our @EXPORT_OK = qw( sigwarn_silencer modver_gt_or_eq fail_on_internal_wantarray fail_on_internal_call refdesc refcount hrefaddr is_exception + perlstring UNRESOLVABLE_CONDITION ); @@ -75,6 +76,8 @@ sub sigwarn_silencer ($) { return sub { &$orig_sig_warn unless $_[0] =~ $pattern }; } +sub perlstring ($) { q{"}. quotemeta( shift ). q{"} }; + sub hrefaddr ($) { sprintf '0x%x', &Scalar::Util::refaddr||0 } sub refdesc ($) { diff --git a/t/resultset/rowparser_internals.t b/t/resultset/rowparser_internals.t index b089ecc..dd89b40 100644 --- a/t/resultset/rowparser_internals.t +++ b/t/resultset/rowparser_internals.t @@ -5,6 +5,7 @@ use Test::More; use lib qw(t/lib); use DBICTest; use B::Deparse; +use DBIx::Class::_Util 'perlstring'; # globally set for the rest of test # the rowparser maker does not order its hashes by default for the miniscule @@ -758,7 +759,7 @@ sub is_same_src { SKIP: { skip "Not testing equality of source containing defined-or operator on this perl $]", 1 if ($] < 5.010 and$expect =~ m!\Q//=!); - $expect =~ s/__NBC__/B::perlstring($DBIx::Class::ResultSource::RowParser::Util::null_branch_class)/ge; + $expect =~ s/__NBC__/perlstring($DBIx::Class::ResultSource::RowParser::Util::null_branch_class)/ge; $expect = " { use strict; use warnings FATAL => 'all';\n$expect\n }";