Commit | Line | Data |
1c4d0148 |
1 | #!/usr/bin/perl |
2 | |
3 | package Devel::REPL::Plugin::Peek; |
4 | use Devel::REPL::Plugin; |
5 | |
6 | use Devel::Peek qw(Dump); |
7 | |
8 | use namespace::clean -except => [ 'meta' ]; |
9 | |
10 | with qw(Devel::REPL::Plugin::Turtles); |
11 | |
12 | sub expr_command_peek { |
13 | my ( $self, $eval, $code ) = @_; |
14 | |
1c4d0148 |
15 | # can't override output properly |
16 | # FIXME do some dup wizardry |
17 | Dump( $self->eval($code) ); |
18 | |
19 | return ""; # this is a hack to print nothing after Dump has already printed. PLZ TO FIX KTHX! |
20 | } |
21 | |
22 | __PACKAGE__ |
23 | |
24 | __END__ |
25 | |
26 | =pod |
27 | |
28 | =head1 NAME |
29 | |
30 | Devel::REPL::Plugin::Peek - L<Devel::Peek> plugin for L<Devel::REPL>. |
31 | |
32 | =head1 SYNOPSIS |
33 | |
34 | repl> #peek "foo" |
35 | SV = PV(0xb3dba0) at 0xb4abc0 |
36 | REFCNT = 1 |
37 | FLAGS = (POK,READONLY,pPOK) |
38 | PV = 0x12bcf70 "foo"\0 |
39 | CUR = 3 |
40 | LEN = 4 |
41 | |
42 | =head1 DESCRIPTION |
43 | |
44 | This L<Devel::REPL::Plugin> adds a C<peek> command that calls |
45 | L<Devel::Peek/Dump> instead of the normal printing. |
46 | |
47 | =head1 SEE ALSO |
48 | |
49 | L<Devel::REPL>, L<Devel::Peek> |
50 | |
51 | =head1 AUTHOR |
52 | |
53 | Yuval Kogman E<lt>nothingmuch@woobling.orgE<gt> |
54 | |
55 | =cut |