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

[perl #128241] Deprecate /$empty_string/

Thread Previous | Thread Next
Father Chrysostomos
May 26, 2016 04:56
[perl #128241] Deprecate /$empty_string/
Message ID:
# New Ticket Created by  Father Chrysostomos 
# Please include the string:  [perl #128241]
# in the subject line of all future correspondence about this issue. 
# <URL: >

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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About