Polynomial,
With Perl 5.10.x, there is support for named captures. If you can't guarantee perl 5.10.x, then there is Regexp::NamedCaptures by diotalevi but I have no idea how stable it is. I know you said anonymous but doesn't your problem go away if you no longer treat them that way?