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, <perl@peknet.com>
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.
bug-swish-prog at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc SWISH::Prog
You can also look for information at:
Mailing list
http://lists.swish-e.org/listinfo/users
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=SWISH-Prog
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/SWISH-Prog
CPAN Ratings
http://cpanratings.perl.org/d/SWISH-Prog
Search CPAN
http://search.cpan.org/dist/SWISH-Prog/
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.
http://swish-e.org/, http://swish-e.org/docs/swish-config.html#replacerules
To install SWISH::Prog, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SWISH::Prog
CPAN shell
perl -MCPAN -e shell install SWISH::Prog
For more information on module installation, please visit the detailed CPAN module installation guide.