in reply to returning variable from within regex

I would like to create a third variable based on the regex match generated above

That sounds like you think you want a symref (perldoc perlreftut), but 99.95% of the time what you really mean is you want to use it as the key of a hash instead.

Also see perldoc perlreftut for information on backreferences for determining what matched.