Leo Simons wrote: > > I'm learning regexp at the moment but I've so far not succeeded at > writing the perl snippet that should accomplish the above so it'd be > cool if some perl guru out there were to help a little? (if not my +1 > indicates I will spend an afternoon or two figuring out how to do this I > guess :D) >
I am by no means a Perl guru, but I read Programming Perl a year or two ago. I wrote a little script in Perl and tested it briefly (although Java would have worked just as well). It doesn't add @author to files that don't have them (if such a file exists), but it does replace any existing authors with "Apache Avalon Development Team". I'd send a diff, but it's about 115k of wasted bandwidth, plus you might have more fun executing it yourself (with modifications or whatever). The script recurses into subdirectories, looking for files that end in .java. When it finds java, it copies the contents into a temporary file. While it copies, it replaces the first occurance of @author with a user specified author and ignores all the other @authors as they come up. It sticks a \r\n onto the end of the changed line by default -- depending on your OS you may want to change that. David Weitzman
convert.pl
Description: Binary data
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
