in reply to multiple matches in regex
I think you didn't quite get my point about reducing your code to the smallest possible program that illustrates the problem. You've got so much extraneous data (and code) that it's really hard to see what might be going wrong. It's also not clear what result you're expecting, and you didn't show what result you got. When I run your code, it tells me there are two matches, and your description seems to imply that you expect two... so I'm not even sure you have a problem.
(Aside: If you're going to use vars all your variables, and call your subroutines with &, you may as well not bother with use strict.)
|
|---|