perl5 icon indicating copy to clipboard operation
perl5 copied to clipboard

Need docs demonstrating how to replace 'goto LABEL'

Open jkeenan opened this issue 2 months ago • 3 comments

As part of my research on Fatalization of currently deprecated goto construct I have been re-reading our current documentation of goto in blead and have been trying to locate in our test suite examples of each claim made in that documentation. What we find -- or fail to find -- there will have an impact on the documentation updates provided as part of a pull request like the current https://github.com/Perl/perl5/pull/23782. I've posted the preliminary results of that documentation review here. This is the first in a series of GH issues addressing the items which I believe are lacking in that documentation.

perldoc -f goto states that goto:

can be used to go almost anywhere else within the dynamic scope,
including out of subroutines, but it's usually better to use
some other construct such as "last" or "die".

Can this value judgment be illustrated via tests in the Perl 5 test suite? (So far I have not been able to locate any.)

Such examples would be very helpful in repairing any damage to CPAN libraries that occur as part of a fatalization of certain aspects of goto LABEL.

jkeenan avatar Oct 04 '25 16:10 jkeenan