in reply to Re^2: How to get ($1, $2, ...)?
in thread How to get ($1, $2, ...)?

I'd try a combination of m//g in scalar context and using the \G marker. If necessary, you can control where it matches by setting pos().

Sorry for not presenting a coded solution, I don't understand your problem well enough to give one.

Anno