You are viewing the version of this documentation from Perl 5.28.3. View the latest version
$<digits> ($1, $2, ...)

Contains the subpattern from the corresponding set of capturing parentheses from the last successful pattern match, not counting patterns matched in nested blocks that have been exited already.

Note there is a distinction between a capture buffer which matches the empty string a capture buffer which is optional. Eg, (x?) and (x)? The latter may be undef, the former not.

These variables are read-only and dynamically-scoped.

Mnemonic: like \digits.