File Coverage

blib/lib/Devel/REPL/Plugin/Peek.pm
Criterion Covered Total %
statement 17 23 73.9
branch 0 2 0.0
condition n/a
subroutine 6 7 85.7
pod 0 2 0.0
total 23 34 67.6


line stmt bran cond sub pod time code
1 2     2   2618 use strict;
  2         3  
  2         56  
2 2     2   7 use warnings;
  2         4  
  2         104  
3             package Devel::REPL::Plugin::Peek;
4             # ABSTRACT: L<Devel::Peek> plugin for L<Devel::REPL>.
5              
6             our $VERSION = '1.003028';
7              
8 2     2   7 use Devel::REPL::Plugin;
  2         3  
  2         15  
9 2     2   8562 use Devel::Peek qw(Dump);
  2         775  
  2         10  
10 2     2   157 use namespace::autoclean;
  2         4  
  2         47  
11              
12             sub BEFORE_PLUGIN {
13 1     1 0 3 my $self = shift;
14 1         4 $self->load_plugin('Turtles');
15             }
16              
17             sub expr_command_peek {
18 0     0 0   my ( $self, $eval, $code ) = @_;
19              
20 0           my @res = $self->eval($code);
21              
22 0 0         if ( $self->is_error(@res) ) {
23 0           return $self->format(@res);
24             } else {
25             # can't override output properly
26             # FIXME do some dup wizardry
27 0           Dump(@res);
28 0           return ""; # this is a hack to print nothing after Dump has already printed. PLZ TO FIX KTHX!
29             }
30             }
31              
32             __PACKAGE__
33              
34             __END__
35              
36             =pod
37              
38             =encoding UTF-8
39              
40             =head1 NAME
41              
42             Devel::REPL::Plugin::Peek - L<Devel::Peek> plugin for L<Devel::REPL>.
43              
44             =head1 VERSION
45              
46             version 1.003028
47              
48             =head1 SYNOPSIS
49              
50             repl> #peek "foo"
51             SV = PV(0xb3dba0) at 0xb4abc0
52             REFCNT = 1
53             FLAGS = (POK,READONLY,pPOK)
54             PV = 0x12bcf70 "foo"\0
55             CUR = 3
56             LEN = 4
57              
58             =head1 DESCRIPTION
59              
60             This L<Devel::REPL::Plugin> adds a C<peek> command that calls
61             L<Devel::Peek/Dump> instead of the normal printing.
62              
63             =head1 SEE ALSO
64              
65             L<Devel::REPL>, L<Devel::Peek>
66              
67             =head1 SUPPORT
68              
69             Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-REPL>
70             (or L<bug-Devel-REPL@rt.cpan.org|mailto:bug-Devel-REPL@rt.cpan.org>).
71              
72             There is also an irc channel available for users of this distribution, at
73             L<C<#devel> on C<irc.perl.org>|irc://irc.perl.org/#devel-repl>.
74              
75             =head1 AUTHOR
76              
77             Yuval Kogman E<lt>nothingmuch@woobling.orgE<gt>
78              
79             =head1 COPYRIGHT AND LICENCE
80              
81             This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>).
82              
83             This is free software; you can redistribute it and/or modify it under
84             the same terms as the Perl 5 programming language system itself.
85              
86             =cut