in reply to Re^2: Extracting /regex/mg in a while loop
in thread Extracting /regex/mg in a while loop

G'day haj,

++ Thanks for the tip.

For anyone looking for portability, DRYness, and an easy way to add more tests, replace all the code prior to the start of the subroutine definitions with:

Update: I made an error with the original code I posted. I've stricken that code and replaced it with a rewrite which works correctly. That rewrite includes all of the additional features: "portability, DRYness, and an easy way to add more tests". The code I posted below is no longer valid; I've stricken it and placed it in a spoiler. The final paragraph, about adding new tests, is still valid: I left it unchanged.

For more tests, add your subroutine and its name to @bench_names; the rest is done for you.

— Ken