develooper Front page | perl.perl5.porters | Postings from May 2016

[perl #128241] Deprecate /$empty_string/

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
May 26, 2016 04:56
Subject:
[perl #128241] Deprecate /$empty_string/
Message ID:
rt-4.0.18-23363-1464238541-1251.128241-75-0@perl.org
# New Ticket Created by  Father Chrysostomos 
# Please include the string:  [perl #128241]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128241 >


It often comes up on the list that /$foo/ is subject to re-use of the last match if $foo is empty, and most people then admit that it was a mistake, and that the last match should be used only when the // is syntactically empty.  (I believe we have consensus on this, but I may be mistaken.)

Because of backward-compatibility, we cannot simply change it, but we could emit a deprecation warning whenever /$foo/ uses the last successful match.

I suspect this will catch many bugs in people’s code.  After the deprecation cycle, we can make /$foo/ behave the same way as /(?:$foo)/.

-- 

Father Chrysostomos


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