What do you do when you discover that the production version of an application is not the same as the development version? (ignore the bigger problems of application development workflow)
You identify the files in question, yes. And what do you identity them when the application contains thousands of source files?
Of course, you make a script.

I recently encountered the following ColdFusion problem:
I had a HTML page where the head node contained an attribute: <head lang="fr">
The same page was also using some cfform tags.
On the CF 8 server, ColdFusion automatically injects two <script> statements immediately after <head, but ignoring any other attribute. So, in our case, the resulting HTML code was: