in reply to Re^2: Faster regex to split a string into runs of similar characters?
in thread Faster regex to split a string into runs of similar characters?
On a related note: Any ideas why this:Looks like a bug fix. expr =~ /.../g attaches position magic to the LHS after each match, to record the current pos() for that expression. If expr is a var or similar this works well; if expr returns something new each time, the old pos magic gets lost.Works (runs to completion, produces the desired results) on 5.10.1, but silently loops forever in 5.22.0?while( substr( $$str, $y * $WIDTH, $WIDTH ) =~ m[((.)\2*)]mg ) { ...
This similarly loops forever:
sub f { "abc" } 1 while f() =~ /./g;
Dave.
|
---|
In Section
Seekers of Perl Wisdom