-
Notifications
You must be signed in to change notification settings - Fork 559
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
Alternation leaves positional variable set sometimes #7518
Comments
From [email protected]Created by [email protected]This program, when run on most systems, only returns a defined result This is a loop that breaks a line into groups of words, those groups Some simpler cases do not malfunction - this is an artificial test #! /usr/bin/perl -w I believe that this is a bug - and the sysadmin of this Also, was it fixed on purpose or by accident in the newer versions Perl Info
|
From @hvds"njs.perlbug@spameater.squawk.com (via RT)" <perlbug-followup@perl.org> wrote: I wasn't able to reproduce your problem on my RedHat system here with any However, I believe the regexp engine has historically had some bugs m{ \G (?: There have also been various bugs fixed in the past regarding correctly Note that your version output shows: :Locally applied patches: .. ie this was "perl 5.8.1 release candidate 4", rather than the actual In any event, the intention is that $1 should be undef if that alternate Hugo |
The RT System itself - Status changed from 'new' to 'open' |
From [email protected]On Fri, 2004-10-01 at 08:48, Hugo van der Sanden via RT wrote:
When this problem was reported to me, I had the same issue in that I
I tried the suggested alteration of the pattern, however, and I am sorry [nick@grp nick]$ ./error_test I've tried some variations on this - this was a test where I tried using I had thought that moving part of the complex program logic of walking Something like this will probably work reliably despite the failure: pos($a) = Yes, the stuff with $lagpos is required since a failed pattern match I am also not sure when you have to initially set pos and when you do
I had searched for such bugs without success before reporting this. As
I'm leaving this in because I'm bccing my response to the systems Thanks for your help. |
From @ysthOn Fri, Oct 01, 2004 at 04:42:22PM -0400, Nick Simicich wrote:
No, it's not smart enough; a /\Gfoo|\Gbar/ pattern will try matching $ perl -we'use re "debug"; $_="x"x99; $_.="bar"; pos($x)=99; /\Gfoo|\Gbar/' then try: $ perl -we'use re "debug"; $_="x"x99; $_.="bar"; pos($x)=99; /\G(?:foo|bar)/'
Use /gc instead of just /g to preserve pos() when the regex fails. |
From [email protected]I can reproduce this with perl-5.8.1 RC4 but not with perl-5.8.1 (or So this seems to be fixed. |
[email protected] - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#31782 (status was 'resolved')
Searchable as RT31782$
The text was updated successfully, but these errors were encountered: