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