line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
2
|
|
|
2
|
|
39634
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
58
|
|
2
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
108
|
|
3
|
|
|
|
|
|
|
package Devel::REPL::Plugin::DDS; |
4
|
|
|
|
|
|
|
# ABSTRACT: Format results with Data::Dump::Streamer |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.003028'; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
8
|
use Devel::REPL::Plugin; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
13
|
|
9
|
2
|
|
|
2
|
|
7123
|
use Data::Dump::Streamer (); |
|
2
|
|
|
|
|
38464
|
|
|
2
|
|
|
|
|
46
|
|
10
|
2
|
|
|
2
|
|
14
|
use namespace::autoclean; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
17
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
around 'format_result' => sub { |
13
|
|
|
|
|
|
|
my $orig = shift; |
14
|
|
|
|
|
|
|
my $self = shift; |
15
|
|
|
|
|
|
|
my @to_dump = @_; |
16
|
|
|
|
|
|
|
my $out; |
17
|
|
|
|
|
|
|
if (@to_dump > 1 || ref $to_dump[0]) { |
18
|
|
|
|
|
|
|
if (@to_dump == 1 && overload::Method($to_dump[0], '""')) { |
19
|
|
|
|
|
|
|
$out = "@to_dump"; |
20
|
|
|
|
|
|
|
} else { |
21
|
|
|
|
|
|
|
my $dds = Data::Dump::Streamer->new; |
22
|
|
|
|
|
|
|
$dds->Freezer(sub { "$_[0]"; }); |
23
|
|
|
|
|
|
|
$dds->Data(@to_dump); |
24
|
|
|
|
|
|
|
$out = $dds->Out; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} else { |
27
|
|
|
|
|
|
|
$out = $to_dump[0]; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
$self->$orig($out); |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__END__ |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=pod |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=encoding UTF-8 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
Devel::REPL::Plugin::DDS - Format results with Data::Dump::Streamer |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
version 1.003028 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 SYNOPSIS |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
# in your re.pl file: |
51
|
|
|
|
|
|
|
use Devel::REPL; |
52
|
|
|
|
|
|
|
my $repl = Devel::REPL->new; |
53
|
|
|
|
|
|
|
$repl->load_plugin('DDS'); |
54
|
|
|
|
|
|
|
$repl->run; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
# after you run re.pl: |
57
|
|
|
|
|
|
|
$ map $_*2, ( 1,2,3 ) |
58
|
|
|
|
|
|
|
$ARRAY1 = [ |
59
|
|
|
|
|
|
|
2, |
60
|
|
|
|
|
|
|
4, |
61
|
|
|
|
|
|
|
6 |
62
|
|
|
|
|
|
|
]; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
$ |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SUPPORT |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL> |
69
|
|
|
|
|
|
|
(or L<bug-Devel-REPL@rt.cpan.org|mailto:bug-Devel-REPL@rt.cpan.org>). |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
There is also an irc channel available for users of this distribution, at |
72
|
|
|
|
|
|
|
L<C<#devel> on C<irc.perl.org>|irc://irc.perl.org/#devel-repl>. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 AUTHOR |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>) |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENCE |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>). |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
83
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=cut |