in reply to Re^2: Sum of N elements in an M element array
in thread Sum of N elements in an M element array

He's building a regex which is trying to match n numbers, because of the (fail) it keeps backtracking to match all possibilities.

The embedded Perl code ensures the output before backtracking to the next match.

I actual like seeing such code as answers to lazy questions. ;)

  • Comment on Re^3: Sum of N elements in an M element array