Yes ++
updated: minidb dumper, thx marioroy
From a bundle I use a lot:
use strict;
use warnings;
package My::Bundle {
use Data::Dumper::AutoEncode ();
use Data::Rmap 'rmap_ref';
use Import::Into;
use parent 'Exporter';
our @EXPORT = 'Dumper';
sub import {
shift->export_to_level(1);
strict ->import::into(1);
warnings ->import::into(1);
strictures ->import::into(1, 2 => 1);
feature ->import::into(1, 'say', 'state');
utf8 ->import::into(1);
autodie ->import::into(1);
Encode->import::into(1);
List::Util->import::into(1, qw/ any all first max maxstr min m
+instr sum sum0 pairkeys pairvalues pairgrep pairmap shuffle uniq /);
Method::Signatures->import::into(1);
Path::Tiny->import::into(1);
Time::Piece->import::into(1);
Time::Seconds->import::into(1);
Try::Tiny->import::into(1);
}
# These are global vars; localize them unless
# you want *everything* to be changed
$Data::Dumper::Deepcopy = 1;
$Data::Dumper::Indent = 1;
$Data::Dumper::Purity = 1;
$Data::Dumper::Quotekeys = 0;
$Data::Dumper::Sortkeys = 1;
$Data::Dumper::Terse = 1;
sub Dumper {
rmap_ref {
if ( my $class = ref($_) ) {
$class = $_->blessed if $class eq 'MCE::Shared::Object
+';
if ( $class->isa('MCE::Shared::Array') ) {
$_ = [ $_->can('export') ? @{ $_->export } : $_->v
+alues ];
}
elsif ( $class->isa('MCE::Shared::Hash') ) {
$_ = { $_->can('export') ? %{ $_->export } : $_->p
+airs };
}
elsif ( $class->isa('MCE::Shared::Minidb') ) {
my $db = $_;
$_ = $db->lkeys ? [ { $db->hpairs }, { $db->lpairs
+ } ] : [ { $db->hpairs } ];
}
elsif ( $class->isa('MCE::Shared::Ordhash') ) {
$_ = $_->clone;
}
elsif ( $class->isa('MCE::Shared::Scalar') ) {
$_ = $_->get;
}
}
} @_;
return Data::Dumper::AutoEncode::eDumper(@_);
}
};
1; # return true
Hope this helps!
The way forward always starts with a minimal test.
|