I need to do a fairly complex search and replace across an entire site's
files.

Find files ending in certain extensions (over 1,700 files)
Exclude files in certain directories
Search contents of matching files for a certain pattern.  If found, rewrite
the file replacing the pattern..
Preserve the file modification date on modified files.

While I was able to do most of this on the command line in Linux (find,
grep, sed), preserving the modification date on the files didn't appear to
be an option.  (Also it removed write permission on the files... Easily
fixed, but just odd.)

I've started working on a Perl program that would (hopefully) do all of
this.

File::Find;
File::stat;
utime

appears to be the basis for getting this done.

But I'm wondering if I'm somewhat reinventing the wheel (i.e. rewriting an
existing Perl module), but I haven't been able to find such a thing.  This
seems like it could be a common enough problem that there could be a module.

Just wondering if anyone else had run across such a module?  (Or alternate
way.)

-- 
-- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nlug-talk?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to