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

use warnings 'absolutely-all-almost';

Thread Next
Ricardo Signes
January 24, 2015 16:54
use warnings 'absolutely-all-almost';
Message ID:
I don't think I can conscience being the guy who said it was okay for "all" to
mean "some."  I think there's some really okay thinking behind doing that, but

Having "use warnings" mean "use warnings 'default'" instead of "use warnings
'all'" seems like a less confusing change in the long run.

The primary objection is that we've long said that "use warnings" means "use
warnings 'all" and that people have used this, explicitly, in their code.  So,
here and there, things like:

  use warnings 'all';
  use warnings FATAL => 'all';

The most problematic case might be when someone wants to do this in code that
may run on multiple versions of Perl, and someone suggested we'd see:

  use warnings ($] >= 5.022 ? 'default' : 'all');
  warnings->import($] >= 5.022 ? 'default' : 'all');
  use warnings FATAL => ($] >= 5.022 ? 'default' : 'all');

...but the first two could really just drop the argument and work.  So, we're
left with that last one.  Frankly, users of (FATAL => 'all') have expressly
opted for a life of crime, and the big "Hic Sunt Dracones" warning in says so.  From 5.20, they can already just say "use warnings
'FATAL'" too.

So, unless there is a great argument against doing this, we should:

* for sure: revert the earlier change
* probably: apply a new change making 'default' exist and documented
* mayyyybe: add a new warning that is in 'all' and not 'default'

The third one makes me a little anxious, as we're headed toward user-visible
code freeze.  It would be nice to start the ball rolling, but if there is any
trouble, I'd want it to wait for 5.23.0 -- a bit disappointing, perhaps, but
with the policy question settled.


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