From: Sartak Date: Wed, 18 Feb 2009 00:58:40 +0000 (+0000) Subject: r80226@onn: sartak | 2009-02-17 19:58:22 -0500 X-Git-Tag: v1.003015~67 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bbea729e0b9c3eb63931565b7047b447e3e45b88;p=p5sagit%2FDevel-REPL.git r80226@onn: sartak | 2009-02-17 19:58:22 -0500 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 --- diff --git a/Changes b/Changes index 20f8a58..d1bb096 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,6 @@ +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 diff --git a/lib/Devel/REPL/Plugin/DDS.pm b/lib/Devel/REPL/Plugin/DDS.pm index fe35319..20ead7e 100644 --- a/lib/Devel/REPL/Plugin/DDS.pm +++ b/lib/Devel/REPL/Plugin/DDS.pm @@ -9,10 +9,14 @@ around 'format_result' => sub { 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; }