develooper Front page | perl.perl5.porters | Postings from June 2015

Re: for 5.24: new categories for strict/warnings?

Thread Previous | Thread Next
From:
Paul "LeoNerd" Evans
Date:
June 5, 2015 16:04
Subject:
Re: for 5.24: new categories for strict/warnings?
Message ID:
20150605170416.344b8833@shy.leonerd.org.uk
On Fri, 5 Jun 2015 16:42:35 +0100
Smylers <Smylers@stripey.com> wrote:

> It'd be better for a plain use warnings to mean ‘the warnings of
> whichever version I've specified, defaulting to v5.22 if none’. Then
> Eddie can get his desired behaviour with:
> 
>   use v5.24;
>   use warnings;
> 
> On finding itself invoked without any tags, warnings would then see
> that use v5.24 has been specified, and so behave like use warnings
> 'v5.24'.
> 
> That way Perl can safely introduce new warnings every version, and
> users get to benefit from the new warnings straightforwardly, yet
> people can still upgrade cautiously.

I wonder if there'd be possibility of this applying something like

  use v5.24;  ==>  $^H{requested_version} = '5.024';

such that now warnings.pm can simply inspect the caller's hints hash
for this key, to see what version we're working to. An unqualified

  use warnings;

could then mean the same as

  use warnings ':5.24';

in this case.

-- 
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