If the object we're dumping has stringification overloading, then use it directly
git-svn-id: http://dev.catalyst.perl.org/repos/bast/trunk/Devel-REPL@5511
bd8105ee-0ff8-0310-8827-fb3f25b6796d
+upcoming
+ - If the object we're dumping has stringification overloading, then use
+ it directly
1.3.4
- resolve rt.cpan#43109 Missing deps for Default Profile Plugins
1.3.3
my $to_dump = (@_ > 1) ? [@_] : $_[0];
my $out;
if (ref $to_dump) {
- my $dds = Data::Dump::Streamer->new;
- $dds->Freezer(sub { "$_[0]"; });
- $dds->Data($to_dump);
- $out = $dds->Out;
+ if (overload::Method($to_dump, '""') {
+ $out = "$to_dump";
+ } else {
+ my $dds = Data::Dump::Streamer->new;
+ $dds->Freezer(sub { "$_[0]"; });
+ $dds->Data($to_dump);
+ $out = $dds->Out;
+ }
} else {
$out = $to_dump;
}