Data::SearchReplacePerl extention for searching and replacing entries in complex data structures | |
Download |
Data::SearchReplace Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Stephen D. Wells
- Publisher web site:
- http://search.cpan.org/~yxes/Crypt-Imail-0.01/Imail.pm
Data::SearchReplace Tags
Data::SearchReplace Description
Perl extention for searching and replacing entries in complex data structures Data::SearchReplace is a Perl module for searching and replacing entries in complex data structures.SYNOPSIS use Data::SearchReplace ('sr'); sr({ SEARCH => 'searching', REPLACE => 'replacing'}, $complex_var); # or OO use Data::SearchReplace; $sr = Data::SearchReplace->new({ SEARCH => 'search for this', REPLACE => 'replace with this' }); $sr->sr($complex_var); $sr->sr($new_complex_var); # if you want more control over your search/replace pattern you # can pass an entire regex instead complete with attributes sr({ REGEX => 's/nice/great/gi' }, $complex_var); # you can even use a subroutine if you'd like # the input variable is the value and the return sets the new # value. sr({ CODE => sub { uc($_) } }, $complex_var); # now sr has a return value for the number of variables it changed my $ret = sr({ SEARCH => 'searching', REPLACE => 'replacing'}, $complex_var); # returns the number of variables it matched Requirements: · Perl
Data::SearchReplace Related Software