}
my $me_struct;
- $me_struct = __visit_dump({ map { $_ => "\xFF__VALPOS__$my_cols->{$_}__\xFF" } (keys %$my_cols) })
- if keys %$my_cols;
+ $me_struct = __result_struct_to_source($my_cols) if keys %$my_cols;
if ($args->{hri_style}) {
$me_struct =~ s/^ \s* \{ | \} \s* $//gx
}
my $me_struct;
- $me_struct = __visit_dump({ map { $_ => "\xFF__VALPOS__$my_cols->{$_}__\xFF" } (keys %$my_cols) })
- if keys %$my_cols;
+ $me_struct = __result_struct_to_source($my_cols) if keys %$my_cols;
$me_struct = sprintf( '[ %s ]', $me_struct||'' )
unless $args->{hri_style};
);
}
-# keep our own DD object around so we don't have to fitz with quoting
-my $dumper_obj;
-sub __visit_dump {
-
- # we actually will be producing functional perl code here,
- # thus no second-guessing of what these globals might have
- # been set to. DO NOT CHANGE!
- ($dumper_obj ||= do {
- require Data::Dumper;
- Data::Dumper->new([])
- ->Useperl (0)
- ->Purity (1)
- ->Pad ('')
- ->Useqq (0)
- ->Terse (1)
- ->Quotekeys (1)
- ->Deepcopy (0)
- ->Deparse (0)
- ->Maxdepth (0)
- ->Indent (0) # faster but harder to read, perhaps leave at 1 ?
- })->Values ([$_[0]])->Dump;
+sub __result_struct_to_source {
+ sprintf( '{ %s }', join (', ', map
+ { sprintf "%s => '\xFF__VALPOS__%d__\xFF'", perlstring($_), $_[0]{$_} }
+ sort keys %{$_[0]}
+ ));
}
1;
delete $weak_registry->{$slot}
unless $cleared->{hash_merge_singleton}{$weak_registry->{$slot}{weakref}{behavior}}++;
}
- elsif (
- $slot =~ /^Data::Dumper/
- and
- $weak_registry->{$slot}{stacktrace} =~ /\QDBIx::Class::ResultSource::RowParser::_mk_row_parser/
- ) {
- # there should be only one D::D object (used to construct the rowparser)
- # more would indicate trouble
- delete $weak_registry->{$slot}
- unless $cleared->{mk_row_parser_dd_singleton}++;
- }
elsif ($slot =~ /^DateTime::TimeZone/) {
# DT is going through a refactor it seems - let it leak zones for now
delete $weak_registry->{$slot};