From: Chris Marshall Date: Sat, 31 Jul 2010 17:20:26 +0000 (-0400) Subject: Add patch submitted for rt.cpan.org #59888 X-Git-Tag: v1.003015~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-REPL.git;a=commitdiff_plain;h=767c76dde72c46f46c5dc4526287b7bcd8ead962 Add patch submitted for rt.cpan.org #59888 This fixes the DDS plugin so that it displays lists of values when a list is returned. The original code would wrap everything in [ ] so you never could see a difference from the default output from the REPL print... --- diff --git a/lib/Devel/REPL/Plugin/DDS.pm b/lib/Devel/REPL/Plugin/DDS.pm index 6e01fe7..9a32449 100644 --- a/lib/Devel/REPL/Plugin/DDS.pm +++ b/lib/Devel/REPL/Plugin/DDS.pm @@ -4,23 +4,23 @@ use Devel::REPL::Plugin; use Data::Dump::Streamer (); around 'format_result' => sub { - my $orig = shift; - my $self = shift; - my $to_dump = (@_ > 1) ? [@_] : $_[0]; - my $out; - if (ref $to_dump) { - 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; - } - $self->$orig($out); + my $orig = shift; + my $self = shift; + my @to_dump = @_; + my $out; + if (@to_dump != 1 || ref $to_dump[0]) { + if (@to_dump == 1 && overload::Method($to_dump[0], '""')) { + $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[0]; + } + $self->$orig($out); }; 1;