in reply to how to dynamically declare a varialble?

See also perldoc perlvar for @- and @+ which can be used (with substr) to fetch out the nth matched subpattern (the entry for @- has the recipie).