in reply to Re^6: about style: use possessive or atomic?
in thread about style: use possessive or atomic?

> Is the warning erroneous?

if the meaning of {n}+ hasn't be deprecated or changed its a totally wrong warning.

Please run my code with 5.20, with same results we should file a bug report.

edit

As you can see there its not redundant.

The plus is neither a greedyness operator here, bc its in second place, its there to stop backtracking.

update
Apparently adding the second + turns the whole quantifier {n}+ into a possessive quantifier.

see here

Like a greedy quantifier, a possessive quantifier repeats the token as many times as possible. Unlike a greedy quantifier, it does not give up matches as the engine backtracks. With a possessive quantifier, the deal is all or nothing. You can make a quantifier possessive by placing an extra + after it. * is greedy, *? is lazy, and *+ is possessive. ++, ?+ and {n,m}+ are all possessive as well.

so + is "greedy" and ++ "possessive", {n}+ is analogous to ++ .

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^8: about style: use possessive or atomic? (BUG!!!)
by LanX (Saint) on Aug 16, 2015 at 22:58 UTC
    so I installed 5.20.2 via perlbrew and it's even getting scarier, the behaviour of {n}+ has changed.

    DB<3> print "aaa" =~ /(a+){1}+a/ aa DB<4> print "aaa" =~ /(a+){1}a/ aa DB<5> print $] 5.020002

    while with 5.14 it's still like documented:

    DB<1> print "aaa" =~ /(a+){1}+a/ DB<2> print "aaa" =~ /(a+){1}a/ aa DB<3> print $] 5.014002

    This is worse than an erroneous warning that's a fatal break of backwards compatibility!

    update

    5.20 is backtracking while told otherwise

    And that's the trace from 5.14

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!

      So I think that you can post it to perlbug with a link to this node?