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

Re: Versioned 'strict'

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
September 12, 2014 08:55
Subject:
Re: Versioned 'strict'
Message ID:
20140912095517.32d4a452@shy.leonerd.org.uk
On Fri, 12 Sep 2014 08:04:56 +0200
Rafael Garcia-Suarez <rgs@consttype.org> wrote:

> On 11 September 2014 20:28, Paul "LeoNerd" Evans
> <leonerd@leonerd.org.uk> 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 strict.pm 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

leonerd@leonerd.org.uk
http://www.leonerd.org.uk/  |  https://metacpan.org/author/PEVANS

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About