|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: Apply A Set Of Regexes To A Stringby atcroft (Monsignor) |
| on Oct 11, 2004 at 02:42 UTC ( #398083=note: print w/ replies, xml ) | Need Help?? |
|
If the regexen are mutually exclusive (ie, they do not affect the same things), then perhaps something along the lines of the following:
This would loop thru a directory at a time, making changes to each file (and saving the original with a .bak extension). The only problem with the code above is if the modifications affect the same things, in which case if all modifications affect all files, you would add them under the '*' set, otherwise you would have to add them to the set for each of the directories (or files, if you need to break it down in that way). I'm not sure if this is necessarily the best way, but it is an idea. Hope it helps.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||