On Sat Dec 25 14:26:58 2010, gelbman@gmail.com wrote: > Under Perl 5.12.1, the following test does not succeed. > > use Test::More; > $_ = "abc"; > ok /\G^/gc; > ok /\G^/gc; # not ok > > Since you can't be on the "other side" of an assertion, I would expect > subsequent regexes to work as the one before them. > > Also, if between the regexes, I put the following, things work as > expected: > > pos($_) = pos($_); Scalar //g will not match a zero-length substring of the same string in the same position twice in a row. This is so that split //, "foo" will work without looping. Setting pos == pos is a common way to reset the internal flag that tracks whether a zero-length match has occurred. I’m not at all surprised that is behaves as you described.Thread Next