# New Ticket Created by Abigail # Please include the string: [perl #71136] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=71136 > This is a bug report for perl from abigail@abigail.be, generated with the help of perlbug 1.39 running under perl 5.10.1. ----------------------------------------------------------------- [Please describe your issue here] While trying to work around bug #59792, I found some different problems: "a" =~ m {(?|(?<A>a)|(?<B>b))} and say $+ {B}; The code about prints 'a'. This shouldn't happen, as the (?<B>b) alternation isn't taken. "a b" =~ m {(?|(?:(?<A>(?<B>a)(?<C>[^ab]*)(?<D>b))) | (?:(?<B>c)(?<C>[^cd]*)(?<D>d)))}x; Afterwards, %- is equal to: (A => ["a b"], B => ["a", "a b"], C => [" ", "a"], D => ["b", " "]) Instead of the expected: (A => ["a b"], B => ["a"], C => [" "], D => ["b"]) Replacing (?|) with (?:) solves it partially (at the expense of having many undefined number variables), but there are still oddities. For instance, 'keys %+' and 'keys %-' don't always return the same set of keys: "0" =~ m {(?:(?<A>0)|(?<B>1))}; say for keys %+; # Prints 'A' say for keys %-; # Prints 'A', 'B' All these issues are still present in 5.11.2.Thread Next