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:use strict if $ENV{'DEVELOPMENT'}
if ($ENV{'use_strict'}) { use strict; }
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?
-Joe
In reply to turn off strict for production code by blahblahblah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |