in reply to Refactoring copy-pasted code
If you Google for "copy paste detection", and "code duplication" you'll find plenty of software, although mostly for Java or C#.
I've tried DuDe, which is kinda useful but far from perfect.
/J