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

Re: patches wanted: default warnings/strict

Thread Previous | Thread Next
Ævar Arnfjörð Bjarmason
October 18, 2015 17:20
Re: patches wanted: default warnings/strict
Message ID:
On Sun, Oct 18, 2015 at 7:11 PM, Paul Johnson <> wrote:
> On Sun, Oct 18, 2015 at 06:20:33PM +0200, Ęvar Arnfjörš Bjarmason wrote:
>> First, let me see if I understand what you'd like. Most of this
>> discussion has been paged out of my brain my now.
> I think you are correct with what needs to be done, but rjbs can
> confirm.


>> We'd also say that if you in the past wrote:
>>     use warnings FATAL => "all";
>> You'd just need to change that to:
>>    use warnings FATAL => "default";
>> Or better yet:
>>     use warnings 'FATAL';
> If that's what the author wants.  I suspect many who write
>   use warnings FATAL => "all";
> will want to leave it just like that.

They probably won't once we start adding pedantic warnings.

>> And finally, we'd change all the documentation to
>> recommend "default" instead of "all", and note how if you want to
>> write programs that function as intended for post-v5.24 and pre-v5.24
>> you need to conditionally enable either "default" or "all".
>> E.g. if you need the recommended set of fatal warnings you should do:
>>     use warnings FATAL => $] >= 5.024000 ? "default" : "all";'
> If you are targeting 5.18 and earlier, yes, otherwise you can get away
> with the plain
>   use warnings "FATAL";
> It's a shame that that is rather messy, but I suppose you can make a
> good case that users of "FATAL all" have made their bed.

It's not just FATAL warnings, although those are a particular sticking
point since before 5.18 that was the recommended and *only* way to
turn them on.

As we start adding pedantic warnings we wouldn't have put into "use
warnings" before for fear of them being too disruptive to existing
code (which is the whole point of this exercise) we're also going to
have some confused users of code that does "use warnings qw(all)" with
the intent of getting the "sane default":

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