Text::Modify::Rule - Modification rule, which can be used to process a Text::Buffer object.
use Text::Modify::Rule; my $rule = new Text::Modify::Rule();
Text::Modify::Rule is a specific modification rule, to be applied for a Text::Modify object.
Text::Modify::Rule
Text::Modify
my $rule = new Text::Modify::Rule();
Text::Modify uses Text::Modify::Rule to process the internal Text::Buffer object, representing the to be modified text.
Text::Buffer
$rule = new Text::Modify::Rule(%options);
This creates a new rule object, to be used with Text::Modify and perform the supplied modification tasks on the Text::Buffer object.
# TODO lots of documenation missing for options to new
my $changes = $rule->process($textbuf);
Process the Text::Buffer object with this rule. Returns the number of modifications performed on the text. Each operation (add, replace, delete) is counted as a modification.
my ($match, $add, $del, $repl) = $rule->getModificationStats();
Returns to number of matches found, lines added, lines deleted and the number of replacements performed.
if ($rule->isError()) { print "Error: " . $rule->getError() . "\n"; }
Simple error handling routines. isError returns 1 if an internal error has been raised. getError returns the textual error.
There definitly are some, if you find some, please report them.
This software is released under the same terms as perl itself. You may find a copy of the GPL and the Artistic license at
http://www.fsf.org/copyleft/gpl.html http://www.perl.com/pub/a/language/misc/Artistic.html
Roland Lammel (lammel@cpan.org)
To install Text::Modify, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Modify
CPAN shell
perl -MCPAN -e shell install Text::Modify
For more information on module installation, please visit the detailed CPAN module installation guide.