Jumping first to your question about the existance of a $wizardextract -- well, yes there is: namely, use of elements enclosed by simple parentheses (eg /(foo) bar (bat)/ inside the regex (more on this below)
perl -e "my $str='foo bar bat'; if ($str =~ /(foo) bar (bat)/ ) {print + \"\$1: $1; \$2: $2)\"; }" $1: foo; $2: bat)
Note 1: 'Doze quoting
Note 2: Other uses of parens exist but are outside the scope of your question.
The parens INSIDE the regex -- that is, between the forward slashes -- tell Perl to capture the elements they enclose (when matched) to the special $n variables. The only parens I found in the first half dozen pages of the text you referenced (TL, DRIA) are those required in the if (...) clause which may be a source of your misunderstanding.
Switching topics: you object to the author invoking chomp before introducing it. That's perhaps pedagologicly sound, but it also misses (missed?) a critical lesson about learning Perl!
You can use your command line and Perl's own documententation to understand (or at least get an introduction to) Perl functions. Here's an example:
perldoc -f chomp chomp VARIABLE chomp( LIST ) chomp This safer version of "chop" removes any trailing string t +hat corresponds to the current value of $/ (also known as $INPUT_RECORD_SEPARATOR in the "English" module). It retur +ns the total number of characters removed from all its arguments. + It's often used to remove the newline from the end of an input +record ....
HTH
Update: fixed last closing code tag's missing < before the slash-c. TY, many times over, to choroba & hippo
In reply to Re: exist backreference variable list?
by ww
in thread exist backreference variable list?
by PerlJam2015
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |