Also, this line uses hardcoded path instead of destDir.

By the way, perl has an in-place editing mode, which would eliminate the need to create a new file and then rename (`perl -i -pe '...' <file>`).