On 2013-06-19 Bob MacCallum <uncool...@gmail.com> wrote:
> so, forgetting the typo for a moment, why doesn't it output
> 012
> 012
> 012
> 012
> ...
> ?
> 
> From my reading of the 5.12 perlre docs, there is no mention of
> moving the cursor along by one position after each match.  Maybe
> that is a more general thing I wasn't aware of.

L<perlre/Repeated Patterns Matching a Zero-length Substring>

Summary: since C<//g> would be an infinite loop, Perl breaks it for
you, advancing the C<pos()> by one after each (0-len) match.

-- 
        Dakkar - <Mobilis in mobile>
        GPG public key fingerprint = A071 E618 DD2C 5901 9574
                                     6FE2 40EA 9883 7519 3F88
                            key id = 0x75193F88

Beware of Programmers who carry screwdrivers.
                -- Leonard Brandwein

Attachment: signature.asc
Description: PGP signature

Reply via email to