Open wollmers opened 5 years ago
That slice shouldn't autovivify in the first place, both elements should exist.
Can you tell me the output of:
perl -V:version
perl -V:archname
Is there a serious reason to use warnings FATAL?
$ perl -V:version
version='5.28.1';
$ perl -V:archname
archname='darwin-2level';
$ perl -v
This is cperl 5, version 28, subversion 1 (v5.28.1c) built for darwin-2level
Copyright 1987-2018, Larry Wall
cperl Copyright (c) 2012-2017 cPanel Inc, 2017-2018 Reini Urban
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
See also: No autovivification of hash slice anymore Fatal Warnings are a Ticking Time Bomb
Is there a serious reason to use warnings FATAL?
No there isn't, but unfatalizing the warning doesn't eliminate the problem it's pointing at.
Either something is wrong with my code, or something is wrong with cperl, and I'd like to know which.
On further inspection it seems the cperl warning is wrong (it warns for any slice-as-argument, not only when it actually autovivifies). This warning is decidedly non-helpful.
Sure, unfatalizing doesn't eliminate the problem. But I do not see the benefit of FATAL, especially in a test script. Maybe it makes sense in a developer release during a phase on CPAN-testers.
At the user (sysadmin, cpan author, end user) it crashes, the installation fails. This can happen with new versions of perl5 or other implementations inventing new warnings.
What will the user do?
If it's unfatalized the test still throws a warning, but the installation works. A minority can still submit an issue.
The pragmatic sense of a warning is giving a hint about a potential problem. In this case it warns at compile time that that autovivification of slice-as-argument is not supported by cperl, while P5P-perl still supports this buggy (inconsistent behaviour, bug not solved in 19 years) feature. Using no warnings 'syntax';
in a narrow lexical context will suppress the warning in all perls.
I agree, that this warning is a little bit unlucky. But it is AFAIK only in cperl-5.28.x and will be removed in cperl-5.30.
But I do not see the benefit of FATAL, especially in a test script. Maybe it makes sense in a developer release during a phase on CPAN-testers.
To the contrary, tests are the only place where it makes sense. In fact, it's probably better to use a module like Test::Warnings to make sure all warnings generate a test failure, instead of only ones in the test file.
Tests are exactly the right time to be strict.
What will the user do?
You're forgetting one option:
I see, you are putting more energy in defending than improving.
I want my modules as portable and stable as possible, including cperl.
I see, you are putting more energy in defending than improving.
Quite frankly I find making this personal incredibly rude.
You come here not with a problem, but dive straight towards a solution. I rejected that solution, but not without explaining why. You're free to suggest other solutions to your problem, but this accusatory attitude is not appreciated.
That's your point of view, mine is opposite.
MacOS 10.14.1 perlbrew cperl5.28.1 cpanm install
Relevant parts of build.log