9 our $VERSION = '1.088';
11 my $whitespace = $ARGV[0] && $ARGV[0] eq '-w' ? shift : 0;
12 my $code = $ARGV[0] ? (-f $ARGV[0] ? shift : \shift) : \join q{}, <STDIN>;
13 my $doc = PPI::Document->new( $code )
14 or die 'Could not parse code: ', PPI::Document::errstr(), "\n";
15 my $dump = PPI::Dumper->new( $doc, whitespace => $whitespace );
20 #-----------------------------------------------------------------------------
26 ppidump - Dump Perl code as PPI structure.
30 ppidump #Read from STDIN
31 ppidump MyModule.pm #Read code from file
32 ppidump 'my $foo = $bar;' #Read code as from string
33 ppidump -w 'foo( );' #Show whitespace tokens
37 This is a simple tool for helping to develop Perl::Critic::Policy
38 modules. If you want to see how L<PPI> would parse a snippet of
39 code, just feed it to C<ppidump>.
41 By default, whitespace tokens are hidden. Use the C<-w> flag to show
46 Jeffrey Ryan Thalhammer <thaljef@cpan.org>
50 Copyright (c) 2005-2008 Jeffrey Ryan Thalhammer. All rights reserved.
52 This program is free software; you can redistribute it and/or modify
53 it under the same terms as Perl itself. The full text of this license
54 can be found in the LICENSE file included with this module.
58 ##############################################################################
61 # cperl-indent-level: 4
63 # indent-tabs-mode: nil
64 # c-indentation-style: bsd
66 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :