|Welcome to the Monastery|
turn off strict for production codeby blahblahblah (Priest)
|on Sep 12, 2005 at 15:04 UTC||Need Help??|
blahblahblah has asked for the wisdom of the Perl Monks concerning the following question:
I work on a very large cgi program that until this year did not use strict at all. I know that's terrible, and I'm not looking to justify it. In fact we're trying to reform our ways, and that's what this post is about.
In our most recent version we finally added 'use strict;' to some files. We found a lot of errors during development and a few more during testing, and felt pretty confident by the time we released the version. However, since the release our customers have uncovered a few more errors (always because of symbolic references). I suspect more are lurking, and because we don't have any automated testing it's not likely that we'll find every combination of settings/inputs that cause these errors. That means our customers will find the problems, which is bad.
I'd like to keep strict on for development and testing and then comment it out in the final code that we ship. Is there an easy way to do this without actually keeping different versions of the code?
This gives a syntax error:
This doesn't get an error but it only affects the "if" block:
I'd like to keep the whole script (including the #! line) the same so that we can't accidentally send someone a patch in which we forgot to comment out strict. Anyone have an idea of how to do this?