This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
691d66b
)
Document usage of $_ and pos() inside /(?{...})/.
author
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Mon, 12 Jan 2004 22:44:53 +0000
(22:44 +0000)
committer
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Mon, 12 Jan 2004 22:44:53 +0000
(22:44 +0000)
(see change #2367.)
p4raw-link: @2367 on //depot/perl:
9661b5442a5f8dacc64d54eb1de98575f21de5f2
p4raw-id: //depot/perl@22125
pod/perlre.pod
patch
|
blob
|
blame
|
history
diff --git
a/pod/perlre.pod
b/pod/perlre.pod
index
365cbb9
..
ea88fc0
100644
(file)
--- a/
pod/perlre.pod
+++ b/
pod/perlre.pod
@@
-574,6
+574,10
@@
track of the number of nested parentheses. For example:
/the (\S+)(?{ $color = $^N }) (\S+)(?{ $animal = $^N })/i;
print "color = $color, animal = $animal\n";
+Inside the C<(?{...})> block, C<$_> refers to the string the regular
+expression is matching against. You can also use C<pos()> to know what is
+the current position of matching withing this string.
+
The C<code> is properly scoped in the following sense: If the assertion
is backtracked (compare L<"Backtracking">), all changes introduced after
C<local>ization are undone, so that