perl5
perl5 copied to clipboard
Fatalization of goto LABEL construct
This pull request supersedes https://github.com/Perl/perl5/pull/23677. (I am filing a new pull request in part because in my own GH repo I changed the name of the branch I wish to merge into blead; network search suggests that filing a new p.r. is the easiest way to proceed.) This commit message incorporates aspects of the earlier p.r.'s commit message.
I've been working on this project over the past month-and-a-half. I am now ready to propose a plan to implement the fatalization of the behavior currently guarded by warnings category deprecated::goto_construct. This pull request would resolve https://github.com/Perl/perl5/issues/23618.
This project is, in effect, a feature removal process, so we have to move carefully. If we remove a feature from core, we also have to remove code testing or otherwise relying on that feature. We have to remove documentation about that feature except insofar as we discuss the removal or suggest other ways to approach the business problem the feature was previously intended to solve. We then have to assess how the feature removal would affect Perl code out in the wild -- which may, in turn, require developing new programs (outside of the core distribution) to facilitate that assessment. I have done all that, so this pull request is being submitted in non-draft status with the hope that we can get it into blead well before the Feb 20 2026 (v5.43-8) "contentious changes" deadline for our next production release in May 2026.
On September 1 we completed one stage in this project. In #23659 (c00b151), we moved many of the code blocks in t/op/goto.t which we anticipate will not be affected by this fatalization to new file t/op/goto-sub.t.
The remaining stages then became:
-
Preliminary code changes in the Perl guts, including removal of the existing deprecation warning and its replacement with a new exception. To support the new exception we'll probably have to update documentation in
pod/perldeprecation.podandperldoc -f goto. We should getmake test_portingto PASS. We should identify tests in the test suite other thant/op/goto*.twhich need to test for an exception rather than a warning. All of this should, IMO, be done before we tacklet/op/goto.thead-on. With the exception of needing more detail in the entry for the fatalization inpod/perldiag.pod, all of this has been done in this pull request. -
Getting the main test files to PASS. That file is
t/op/goto.t, which now passes largely because I have simply stripped out all the code that pertained to the now fatal feature. The extent to which the code remaining in that file exercises ("covers") the remaininggotofeatures needs investigation. -
Identifying the scope of Blead Breaks CPAN (BBC) problems. Since CPANtesters is set up on the premise that we're only testing CPAN distros against perl production/maintenance releases or commits to
blead, we'll have to figure out a way to test against a branch without polluting the CPANtesters matrix. I have done that by revising one of my previous CPAN distributions and releasing it as Test-Against-Commit. I'll include details of my research using that library in a separate post.
Please review. Thank you very much.
- This set of changes requires a perldelta entry, and I need help writing it.