in reply to Re^2: Understanding -> function
in thread Understanding -> function

$1, $2, $3 and so on are capture variables.

Specifically, in the regex
    /^BAK(\w+)\s+(\d+)\s+([\w\_]+)\s*/i
the sub-expressions (\w+), (\d+) and ([\w\_]+) (which, as already noted, is the same as (\w+) since \w is [a-zA-Z0-9_], but under the control of locale) are capturing groups, and whatever these groups match, if anything, is available through the capture variables. See perlre, perlretut (especially Extracting matches) and perlrequick for further discussion of capturing groups and capture variables; in particular, how the number of the variable ($1, $2, $3, etc.) relates to the order of the capture group in the regex.