Filter::Heredoc::Rule - Load or unload rules for heredoc processing
Version 0.05
use 5.010; use Filter::Heredoc::Rule qw( hd_syntax ); # load the 'pod' rule (i.e. activate it) my %rule = hd_syntax( q{pod} ); # print capability and status foreach ( keys %rule ) { print "'$_' '$rule{$_}'\n"; } # unload all with keyword 'none'; hd_syntax( 'none' );
Support here document parsing with rules to prevent "false positives".
Filter::Heredoc::Rule exports following subroutine only on request.
hd_syntax # load/unload a script syntax rule
%rule = hd_syntax( $rulename ); %rule = hd_syntax();
Load or unload the syntax rule to use when parsing a here document. This subroutine use a key/value hash to hold capability and status.
%rule = ( pod => 'pod', )
The rule capability is given by the hash key. To load a rule, use the key as the value in the argument. A rule is deactivated if the value is equal to an $EMPTY_STR (q{}). Supplying the special word 'none' (not case sensitive) deactivates all rules. Only one rule (i.e. 'pod') exists in this release. Returns the hash with key/values.
No messages are printed from any subroutine.
This version only supports one rule.
Please report any bugs or feature requests to http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Filter-Heredoc or at <bug-filter-heredoc at rt.cpan.org>.
<bug-filter-heredoc at rt.cpan.org>
Filter::Heredoc, filter-heredoc
Copyright 2011-18, Bertil Kronlund
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Filter::Heredoc, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Filter::Heredoc
CPAN shell
perl -MCPAN -e shell install Filter::Heredoc
For more information on module installation, please visit the detailed CPAN module installation guide.