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

Re: patches wanted: default warnings/strict

Thread Previous | Thread Next
Paul Johnson
October 18, 2015 17:11
Re: patches wanted: default warnings/strict
Message ID:
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

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

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

Paul Johnson -

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