http://www.perlmonks.org?node_id=187546


in reply to Re: Re: Infinite loop regex
in thread Infinite loop regex

For that matter, if you are grouping all the matches at once, why bother with the temporary string?

for ($obj->method =~ /pat(keep)/g) { print $count++, " $_\n"; # etc. }

--rjray