Perl::Folder - Fold and Unfold Blocks in Perl Code
use Perl::Folder; my $folded = Perl::Folder->fold_blocks($perl); my $unfolded = Perl::Folder->unfold_blocks($folded);
Using regexps to look for values in Perl code is problematic. This module makes it much more reliable.
Say you are looking for a line like this one:
our $VERSION = '0.10';
Matching that line is easy. But that line might be in a heredoc, the DATA section, a POD block or a comment. Also if you try to strip out all heredocs you don't know if they are really part of a POD block of DATA section, and vice versa.
DATA
This module correctly finds these four types of blocks and folds them up, replacing their content with the SHA1 digest of their content.
Ingy döt Net
Copyright (c) 2007. Ingy döt Net. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'döt'. Assuming UTF-8
To install Perl::Folder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Folder
CPAN shell
perl -MCPAN -e shell install Perl::Folder
For more information on module installation, please visit the detailed CPAN module installation guide.