develooper Front page | perl.perl5.porters | Postings from November 2021

strict/warnings versioned bundles

Thread Next
From:
Paul "LeoNerd" Evans
Date:
November 29, 2021 09:55
Subject:
strict/warnings versioned bundles
Message ID:
20211129095502.344227e3@shy.leonerd.org.uk
Currently, a `use VERSION` declaration is equivalent to something like:

  use strict;
  use warnings;
  use feature ':VERSION';  # the major.minor parts at least

As part of the new `builtin` pragma, I think it would be nice to give
it version bundles, so that one day we could extend `use VERSION` to
having it automatically pull in a versioned builtin bundle as well; e.g.

  use v5.40;

could be equivalent to

  use strict;
  use warnings;
  use feature ':5.40';
  use builtin ':5.40';

At this point, I wonder if the strict.pm and warnings.pm ought to
recognise version numbers as well, just to add the same mechanism to
all four, for consistency and future expansion.

That said, I'm not currently sure what such a version declaration would
actually mean for these modules; they don't currently change their
behaviour dependent on that version. But I think it might be nice to
account for some future time at which there might be new strict or
warnings flags that only get enabled at some version.

-- 
Paul "LeoNerd" Evans

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

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