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
Use the bracketing construct (...) to create a capture buffer. Then use the special variables $1, $2, etc to access the captured string.
(...)
if ( m/(interesting)/ ) { my $captured = $1; }