develooper Front page | perl.perl5.porters | Postings from June 2021

Re: deprecating non-default postderef_qq

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
June 15, 2021 19:04
Subject:
Re: deprecating non-default postderef_qq
Message ID:
7df6c357-2662-420c-ba75-9dda9b7bc548@beta.fastmail.com
On Tue, Jun 15, 2021, at 1:36 PM, hv@crypt.org <mailto:hv%40crypt.org> wrote:
> "Ricardo Signes" <perl.p5p@rjbs.manxome.org <mailto:perl.p5p%40rjbs.manxome.org>> wrote:
> >On Sun, May 23, 2021, at 12:23 PM, Ricardo Signes wrote:
> >> That said, I believe this is a very niche feature that we are better served by eliminating.  To do this, I propose:
> >>  * In 5.36.0:  We make cases where postderef_qq would occur, if not for the feature being off, issue a deprecation warning, but act as before.  That is:  "Eat more $pies->@{ $x }" will interpolate $pies and @$x but also warn.  User can eliminate the warning by changing their code to read "Eat more $pies\->@{ $x }".
> >
> >I would like to hereby a branch that makes this happen.  I believe the work (at a very high level) is:
> 
> hereby <x> a branch?

Yes, right.  "solicit"!

> > * add a deprecation warning when the "no feature 'postderef_qq'" behavior is triggered
> > * make sure the perldiag entry indicates how to fix the error while keeping the old behavior
> > * test updates
> 
> Could you clarify which if any of these will be affected?
>   "Eat more $pies-"
>   "Eat more $pies->"
>   "Eat more $pies->@"

I would not expect any of them to be affected.  Here's perl without postderef_qq:
~$ perl -Mfeature=say -e '$pies = [1,2,3]; say "$pies-"'
ARRAY(0x7fd16980ac48)-
~$ perl -Mfeature=say -e '$pies = [1,2,3]; say "$pies->"'
ARRAY(0x7ffc1500ac48)->
~$ perl -Mfeature=say -e '$pies = [1,2,3]; say "$pies->@"'
ARRAY(0x7fbcce80ac48)->@
~$ perl -Mfeature=say -e '$pies = [1,2,3]; say "$pies->@*"'
ARRAY(0x7fecc100ac48)->@*

…and here's the sequence with postderef_qq:

~$ perl -E '$pies = [1,2,3]; say "$pies-"'
ARRAY(0x7fda0e00ac48)-
~$ perl -E '$pies = [1,2,3]; say "$pies->"'
ARRAY(0x7fee2700ac48)->
~$ perl -E '$pies = [1,2,3]; say "$pies->@"'
ARRAY(0x7f903600ac48)->@
~$ perl -E '$pies = [1,2,3]; say "$pies->@*"'
1 2 3

Only the case ->@* is going to change, so only it should warn.

-- 
rjbs
Thread Previous | 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