pfilter - a simple token extractor.
pfilter [options] [types] < [script.pl]
Options:
-b [i] : before characters -a [i] : after characters -l : print the full line -c : highlight the token (with -l) -p : print the name and position -n : print non-matching tokens -t : print the token names only -N : don't print a newline after the token
Types:
Types are regular expressions. Example: ^operator ^keyword ^heredoc ^comment ^format ^backtick For more types, see: C<perldoc Perl::Tokenizer>
Example:
# uncomment and unpod a Perl script: pfilter -N -n '^(?:pod|comment)\z' script.pl > clean_script.pl
pfilter extracts tokens from a Perl script that match a given regular expression.
Daniel "Trizen" Șuteu, <trizen@protonmail.com>
Copyright (C) 2015
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.22.0 or, at your option, any later version of Perl 5 you may have available.
To install Perl::Tokenizer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Tokenizer
CPAN shell
perl -MCPAN -e shell install Perl::Tokenizer
For more information on module installation, please visit the detailed CPAN module installation guide.