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