New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/(?-p)/ should be an error #14936
Comments
From victor@drawall.ccCreated by @GrimyHow to reproduce
Expected behavior Perl should die with the following diagnostic:
Actual behavior Perl terminates normally and prints:
The ${^MATCH} variables get defined, which proves that /p is still in effect. Perl Info
|
From @demerphqOn 25 September 2015 at 19:03, Victor ADAM <perlbug-followup@perl.org> wrote:
I dont know that I agree that Perl should die. We warn instead: $ ./perl -we'qr/(?-p)foo/' Given the mild consequences of this type of mistake I think warnings Unless someone strongly disagrees I would like to close this ticket Thanks for the report though! Yves Yves |
The RT System itself - Status changed from 'new' to 'open' |
From @khwilliamsonOn 10/07/2015 05:34 AM, demerphq wrote:
I agree with Yves. But I think the ticket should be rejected rather |
From victor@drawall.cc
In that case we should fix all the equivalent but inconsistent errors: Unless I’m missing something, the two are essentially the same, and |
From @AbigailOn Wed, Oct 07, 2015 at 10:02:22PM +0200, Victor ADAM wrote:
Yeah, but we have to be practical. /a is fairly new, and /(?-a)/ has What's the gain if /(?-p)/ started dying? [1] If there's a lot of code out there which uses /(?-p)/, then making Abigail |
From @khwilliamsonOn 10/07/2015 03:13 PM, Abigail wrote:
To be sure, there is some subjectivity to this whole thing, and I agree with Abigail, but also, it's obvious what -p would mean, because |
From victor@drawall.cc
The gain would be consistency. However, your reasoning in [1] |
From @khwilliamsonOP said to close this ticket |
@khwilliamson - Status changed from 'open' to 'rejected' |
From @demerphqOn 7 October 2015 at 23:36, Karl Williamson <public@khwilliamson.com> wrote:
While I realize Victor already agreed that this ticket can be (?p) is a bit of an odd case as far as regex flags go. In some ways Unlike most of the other modifiers it shouldn't exist at all (arguably Furthermore regex modifier flags are divided into two groups, parse On the face of things, /p flag is an execution modifier like /g, which perl -le'sub do_match { my ($string,$pattern)= @_; my $count=0; while Once an execution flag becomes embeddable you have to decide what to Whatever we chose to do about (?-p), it should be because it makes Cheers, -- |
Migrated from rt.perl.org#126185 (status was 'rejected')
Searchable as RT126185$
The text was updated successfully, but these errors were encountered: