This array holds the offsets of the ends of the last successful submatches in the currently active dynamic scope.
$+ is the offset into the string of the end of the entire match. This is the same value as what the
pos function returns when called on the variable that was matched against. The nth element of this array holds the offset of the nth submatch, so
$+ is the offset past where
$+ the offset past where
$2 ends, and so on. You can use
$#+ to determine how many subgroups were in the last successful match. See the examples given for the
This variable was added in Perl v5.6.0.