diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-01-12 22:44:53 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2004-01-12 22:44:53 +0000 |
commit | 754091cbb888bc3c0616a4888b5fa4f2a459d234 (patch) | |
tree | 6da4250146777805c9f056ff70c3a2526fed6c48 /pod/perlre.pod | |
parent | 691d66bd80cce8a28b2441860877f52054fc5710 (diff) | |
download | perl-754091cbb888bc3c0616a4888b5fa4f2a459d234.tar.gz |
Document usage of $_ and pos() inside /(?{...})/.
(see change #2367.)
p4raw-link: @2367 on //depot/perl: 9661b5442a5f8dacc64d54eb1de98575f21de5f2
p4raw-id: //depot/perl@22125
Diffstat (limited to 'pod/perlre.pod')
-rw-r--r-- | pod/perlre.pod | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pod/perlre.pod b/pod/perlre.pod index 365cbb9aaa..ea88fc08b5 100644 --- 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 |