3 package Devel::REPL::Plugin::PPI;
4 # ABSTRACT: PPI dumping of Perl code
6 our $VERSION = '1.003028';
8 use Devel::REPL::Plugin;
11 use namespace::autoclean;
15 $self->load_plugin('Turtles');
18 sub expr_command_ppi {
19 my ( $self, $eval, $code ) = @_;
21 my $document = PPI::Document->new(\$code);
22 my $dumper = PPI::Dumper->new($document);
23 return $dumper->string;
34 repl> #ppi Devel::REPL
37 PPI::Token::Word 'Devel::REPL'
43 PPI::Statement::Compound
44 PPI::Structure::Block { ... }
45 PPI::Token::Whitespace '\n'
47 PPI::Token::Word 'warn'
48 PPI::Token::Whitespace ' '
49 PPI::Token::Magic '$]'
50 PPI::Token::Structure ';'
51 PPI::Token::Whitespace '\n'
55 This plugin provides a C<ppi> command that uses L<PPI::Dumper> to dump
56 L<PPI>-parsed Perl documents.
58 The code is not actually executed, which means that when used with
59 L<Deve::REPL::Plugin::OutputCache> there is no new value in C<_>.
63 Shawn M Moore E<lt>sartak@gmail.comE<gt>