NAME

Filter::Heredoc::Rule - Load or unload rules for heredoc processing

VERSION

Version 0.05

SYNOPSIS

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' );

DESCRIPTION

Support here document parsing with rules to prevent "false positives".

SUBROUTINES

Filter::Heredoc::Rule exports following subroutine only on request.

hd_syntax             # load/unload a script syntax rule

hd_syntax

%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.

ERRORS

No messages are printed from any subroutine.

BUGS AND LIMITATIONS

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>.

SEE ALSO

Filter::Heredoc, filter-heredoc

LICENSE AND COPYRIGHT

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.