SWISH::Prog::ReplaceRules - filename mangler
use SWISH::Prog::ReplaceRules; my $rules = SWISH::Prog::ReplaceRules->new( qq(replace "the string you want replaced" "what to change it to"), qq(remove "a string to remove"), qq(prepend "a string to add before the result"), qq(append "a string to add after the result"), qq(regex "/search string/replace string/options"), ); my $uri = 'foo/bar/baz'; my $modified_uri = $rules->apply($uri);
SWISH::Prog::ReplaceRules is a pure Perl replacement for the ReplaceRules configuration feature in Swish-e.
This class is typically used internally by SWISH::Prog. The filter() feature of SWISH::Prog is generated to use ReplaceRules if they are defined in a SWISH::Prog::Config object or config file.
Constructor for new ReplaceRules object. rules should be an array of strings as defined in http://swish-e.org/docs/swish-config.html#replacerules.
Internal method called by new(). Expects an array of rule strings.
Get/set the array ref of parsed rules.
Apply the rules in the object against string. Returns a modified copy of string.
Peter Karman, <firstname.lastname@example.org>
Please report any bugs or feature requests to
bug-swish-prog at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SWISH-Prog. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
You can find documentation for this module with the perldoc command.
You can also look for information at:
Copyright 2011 by Peter Karman
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.