3 package Devel::REPL::Plugin::PPI;
5 use Devel::REPL::Plugin;
8 use namespace::autoclean;
12 $self->load_plugin('Turtles');
15 sub expr_command_ppi {
16 my ( $self, $eval, $code ) = @_;
18 my $document = PPI::Document->new(\$code);
19 my $dumper = PPI::Dumper->new($document);
20 return $dumper->string;
31 Devel::REPL::Plugin::PPI - PPI dumping of Perl code
35 repl> #ppi Devel::REPL
38 PPI::Token::Word 'Devel::REPL'
44 PPI::Statement::Compound
45 PPI::Structure::Block { ... }
46 PPI::Token::Whitespace '\n'
48 PPI::Token::Word 'warn'
49 PPI::Token::Whitespace ' '
50 PPI::Token::Magic '$]'
51 PPI::Token::Structure ';'
52 PPI::Token::Whitespace '\n'
56 This plugin provides a C<ppi> command that uses L<PPI::Dumper> to dump
57 L<PPI>-parsed Perl documents.
59 The code is not actually executed, which means that when used with
60 L<Deve::REPL::Plugin::OutputCache> there is no new value in C<_>.
64 Shawn M Moore E<lt>sartak@gmail.comE<gt>