develooper Front page | perl.perl5.porters | Postings from December 2007

5.11 (or 12) and strict

Thread Next
Steffen Mueller
December 26, 2007 07:12
5.11 (or 12) and strict
Message ID:
Hi p5p,

I'm sure this proposal will be shot down in a second and I'll be banned 
from posting to perl5-porters again*, but I'd never forgive myself for 
not trying:

Personally, I've always wanted perl to have strictures on by default for 
my code. I would think that 95% of all code bases which were written in 
this century and which are of non-negligible size import "strict". I 
don't use strictures for one-liners, of course, but for anything else 
it's a must. It seems to me like others have similar views on this. Try 
posting some code without "use strict" to some newsgroup or forum and 
ask for help. Make sure not to give out your email address, though.

"use 5.10.0;" already auto-imports and loads the 5.10 
specific features.

How about having "use 5.11.0;" (or 5.12.0) automatically import strict 
along with the 5.10+5.11 feature set? Naturally, the -E switch for 
one-liners should *not* do that.

This would *not* break backwards compatibility. This would not affect 
one-liners. This would optimize for the common case: If you write enough 
code to make importing optional features worthwhile, odds are very high 
you'd be importing "strict" anyway. The 5% who need to disable 
strictures again can still add a "no strict;" statement.

strictures-correct code has been best-practice for a long time now. 
Let's make it the default for *new* code.

Just think of strictures as a feature. It just makes sense.


* I'm having a bad day already. Come on make it worse! ;)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About