develooper Front page | perl.perl5.porters | Postings from September 2014

Re: Versioned 'strict'

Thread Previous | Thread Next
Paul "LeoNerd" Evans
September 12, 2014 08:55
Re: Versioned 'strict'
Message ID:
On Fri, 12 Sep 2014 08:04:56 +0200
Rafael Garcia-Suarez <> wrote:

> On 11 September 2014 20:28, Paul "LeoNerd" Evans
> <> wrote:
> > I live in eternal hope that one day, one day, we'll get around to
> > implementing in core some more strictness flags than the current
> > ancient set of three (vars, subs, refs).[*]
> If I remember correctly, this idea was shot down forever for
> backwards-compatibility
> reasons: "use strict" with a new flag is a compile-time error
> currently, so that would
> require to specify a minimum version anyway.

I'm not sure I see how this is any different to, say, "use feature".

"use feature" was added in 5.10, meaning if your program starts

  use feature 'say';

it will crash on 5.8. That was deemed acceptable.

Right now /all/ I am proposing is that accept and silently
ignore a :NUMBER tag, where that number is 5.22 or earlier. This means
you can write

  use strict :5.22;

Yes I know it will crash on a pre-5.21.{mumble} perl in much the same
way that "use feature" will crash pre-5.10. That's OK.


Separately: the "back compat" argument only comes in under the
suggestion that we never change what an unqualified default

  use strict;

does - it always does what it did on perls between 5.8 and 5.20. But
having paved the way for allowing version numbering, we can now ask for
some new strictnesses by the more convenient

  use strict :5.30;

instead of the "make everyone point and laugh at us"

  use strict qw( vars subs refs strings directness dimensions );

Paul "LeoNerd" Evans  |

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