This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlretut: incorrect output in "Non-capturing groupings"
authorÆvar Arnfjörð Bjarmason <avar@cpan.org>
Thu, 30 Sep 2010 09:57:44 +0000 (09:57 +0000)
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>
Thu, 30 Sep 2010 10:09:40 +0000 (11:09 +0100)
Change the example split output in a "Non-capturing groupings" example
from ('12','a','34','b','5') to ('12','a','34','a','5'). This way
it'll match the example code that goes along with it:

    split /(a|b)+/, "12aba34ba5"

Reported-by: Antonio Bonifati <antonio.bonifati@gmail.com>
pod/perlretut.pod

index f218717..3b7413e 100644 (file)
@@ -925,7 +925,7 @@ elements gathered from a split operation where parentheses are
 required for some reason:
 
     $x = '12aba34ba5';
 required for some reason:
 
     $x = '12aba34ba5';
-    @num = split /(a|b)+/, $x;    # @num = ('12','a','34','b','5')
+    @num = split /(a|b)+/, $x;    # @num = ('12','a','34','a','5')
     @num = split /(?:a|b)+/, $x;  # @num = ('12','34','5')
 
 
     @num = split /(?:a|b)+/, $x;  # @num = ('12','34','5')