3

I just went through a large legacy Perl web application (built using cgi-lib.pl and running as CGI with Apache HTTPD) and updated every script to use strict;, fixing a lot of small bugs along the way. Now this is done, I want to prevent people from turning off strict mode. Is there any way for me to enforce that? (We have had this issue before, where use strict; was commented out with a note that it "doesn't work".)

3

There is no substitute for a good code review process and people who care about it. Make strict the default by including it in templates, should be as automatic as a copyright header. File issues. Fine if issues are low priority, but should be taken care of at some point when relevant code is touched. If closed, require better documentation than "doesn't work".

After people agree to this standard, enforce it. Put it somewhere obvious in your tooling, like a lint or tidy config, CI build check, or version control system pre commit check.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.