I thought it might be useful to show the special local matching variables that perl uses. Here they are:
$1..$9 Contains the subpattern from the corresponding set of parentheses in the last pattern matched like \1..\9
$& Contains the string matched by the last pattern match
$` The string preceding whatever was matched by the last pattern match, not counting patterns matched in nested blocks that have been exited already.
$' The string following whatever was matched by the last pattern match, not counting patterns matched in nested blockes that have been exited already.
$+ the last bracket matched by the last search pattern. This is useful if you don't know which of a set of alternative patterns matched.
If you want to know more about these and the global variables, like $_ and $/ go here: