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

Versioned 'strict'

Thread Next
Paul "LeoNerd" Evans
September 11, 2014 18:28
Versioned 'strict'
Message ID:
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).[*]

To allow for the unfortunate back-compat issues that would arise if we
added, say, a fourth flag of "directness" (to implement the current "no
indirect" ability, for example), it would be nice to be able to request
the set of strictness flags present in some particular version.

To that end, I'd like to suggest that we allow

  use strict ':5.20';

say, to mean "that set of flags present by default in 5.20"

((Implementation-wise I think it should be fairly trivial to just store
  a hash in of all the "current" flags, and the version at
  which they appeared, presuming for now we don't never delete any.))

For back-compat reasons I don't think we'd ever be able to change the
default meaning of

  use strict;

but it would be nice some day in a few years time to be able to

  use v5.30;
  use strict ':v5.30';

and have a bunch more strictnesses that that entails, whatever they may


[*]: My particular horse in this race is 'stringification':

  no stringification;

  my $array = [ 1, 2, 3 ];

  print "My array is $array\n";  # dies

Paul "LeoNerd" Evans  |

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