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   4032 use strict;
  2         4  
  2         86  
2 2     2   15 use warnings;
  2         5  
  2         161  
3             package Devel::REPL::Plugin::Peek;
4             # ABSTRACT: L<Devel::Peek> plugin for L<Devel::REPL>.
5              
6             our $VERSION = '1.003027';
7              
8 2     2   15 use Devel::REPL::Plugin;
  2         4  
  2         22  
9 2     2   19504 use Devel::Peek qw(Dump);
  2         3209  
  2         19  
10 2     2   260 use namespace::autoclean;
  2         6  
  2         71  
11              
12             sub BEFORE_PLUGIN {
13 1     1 0 3 my $self = shift;
14 1         9 $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.003027
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 AUTHOR
68              
69             Yuval Kogman E<lt>nothingmuch@woobling.orgE<gt>
70              
71             =head1 COPYRIGHT AND LICENSE
72              
73             This software is copyright (c) 2007 by Matt S Trout - mst (at) shadowcatsystems.co.uk (L<http://www.shadowcatsystems.co.uk/>).
74              
75             This is free software; you can redistribute it and/or modify it under
76             the same terms as the Perl 5 programming language system itself.
77              
78             =cut