5 package Devel::REPL::Plugin::PPI;
6 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 Devel::REPL::Plugin::PPI - PPI dumping of Perl code
38 repl> #ppi Devel::REPL
41 PPI::Token::Word 'Devel::REPL'
47 PPI::Statement::Compound
48 PPI::Structure::Block { ... }
49 PPI::Token::Whitespace '\n'
51 PPI::Token::Word 'warn'
52 PPI::Token::Whitespace ' '
53 PPI::Token::Magic '$]'
54 PPI::Token::Structure ';'
55 PPI::Token::Whitespace '\n'
59 This plugin provides a C<ppi> command that uses L<PPI::Dumper> to dump
60 L<PPI>-parsed Perl documents.
62 The code is not actually executed, which means that when used with
63 L<Deve::REPL::Plugin::OutputCache> there is no new value in C<_>.
67 Shawn M Moore E<lt>sartak@gmail.comE<gt>