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

[perl #133583] Fatalize $* and $#

Thread Next
From:
James E Keenan via RT
Date:
October 13, 2018 02:04
Subject:
[perl #133583] Fatalize $* and $#
Message ID:
rt-4.0.24-13370-1539396262-1204.133583-15-0@perl.org
On Fri, 12 Oct 2018 15:53:39 GMT, jkeenan@pobox.com wrote:
> In this commit we implemented a warning, present in perl-5.28, that the 
> use of $* and $# -- both long deprecated -- was no longer supported.
> 
> #####
> commit a678626e6d2dd11740073117f5269f7efee639de
> Author:     Abigail <abigail@abigail.be>
> AuthorDate: Sun Jan 15 13:23:34 2017 +0100
> 
>      Revert "Remove deprecation warnings related to $* and $#."
> 
>      This reverts commit e9b5346b919b4f4cc0096af4644cb0d48d64e14c.
> 
>      We've decided that instead of leaving $* and $# as usuable, 
> magic-free variables, we instead make it fatal to use them. Therefore, 
> we restore the warnings their use gives, and in a subsequent commit, we 
> fix the warning to indicate the version where their use becomes fatal.
> 
> #####
> 
> In preparation for perl-5.30, we need to fatalize their use and adjusts 
> tests and documentation accordingly.
> 
> Thank you very much.
> 

A draft of an implementation of the fatalization of $* and $# can be found in the smoke-me/jkeenan/133583-fatalize-dollar-asterisk-pound branch or in the attached diff (which squashes all the patches in that branch).  Smoke test results can be found at http://perl.develop-help.com/?b=smoke-me%2Fjkeenan%2F133583-fatalize-dollar-asterisk-pound.

Please review the patch, particularly with respect to the following:

1. gv.c:  Correct usage of Perl_croak; suitability of error message.

2. Tests:

a. I took the warnings tests relevant to this issue and found in t/lib/warnings/gv and created a new file, t/lib/croak/gv Was this appropriate?

b. There were individual tests in several files which used $# or $*, not necessarily for any specific reason.  In order to get 'make test' to PASS, I had to remove many of these tests.  This runs the risk of unintentionally reducing our test coverage.  The test files in question are:

lib/B/Deparse.t
t/op/heredoc.t
t/op/lex.t
t/op/postfixderef.t
t/uni/variables.t

3. Documentation:   So far the only documentation file altered is pod/perldiag.pod.  So I have not yet made any edits in, say, pod/perldelta.pod.

Please review carefully. If satisfactory, I would like to merge to blead by Thursday, October 17, so that we can get it into the monthly release scheduled for October 20 and then see how much CPAN breakage occurs.

Thank you very much.

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133583

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About