If I have a match operator, how do I save the parts of the strings captured in the parentheses in variables instead of using $1, $2, and so on?
$1
$2
@strings goes on the left and will contain result, then goes your input string $input_string. Don't forget flag g for matching all substrings.
@strings
$input_string
g
my @strings=$input_string=~m/stuff (.*) stuff/g;