3 package Devel::REPL::Plugin::PPI;
5 our $VERSION = '1.003027';
7 use Devel::REPL::Plugin;
10 use namespace::autoclean;
14 $self->load_plugin('Turtles');
17 sub expr_command_ppi {
18 my ( $self, $eval, $code ) = @_;
20 my $document = PPI::Document->new(\$code);
21 my $dumper = PPI::Dumper->new($document);
22 return $dumper->string;
33 Devel::REPL::Plugin::PPI - PPI dumping of Perl code
37 repl> #ppi Devel::REPL
40 PPI::Token::Word 'Devel::REPL'
46 PPI::Statement::Compound
47 PPI::Structure::Block { ... }
48 PPI::Token::Whitespace '\n'
50 PPI::Token::Word 'warn'
51 PPI::Token::Whitespace ' '
52 PPI::Token::Magic '$]'
53 PPI::Token::Structure ';'
54 PPI::Token::Whitespace '\n'
58 This plugin provides a C<ppi> command that uses L<PPI::Dumper> to dump
59 L<PPI>-parsed Perl documents.
61 The code is not actually executed, which means that when used with
62 L<Deve::REPL::Plugin::OutputCache> there is no new value in C<_>.
66 Shawn M Moore E<lt>sartak@gmail.comE<gt>