Change 22125 by [EMAIL PROTECTED] on 2004/01/12 22:44:53 Document usage of $_ and pos() inside /(?{...})/. (see change #2367.)
Affected files ... ... //depot/perl/pod/perlre.pod#84 edit Differences ... ==== //depot/perl/pod/perlre.pod#84 (text) ==== Index: perl/pod/perlre.pod --- perl/pod/perlre.pod#83~19804~ Tue Jun 17 06:12:21 2003 +++ perl/pod/perlre.pod Mon Jan 12 14:44:53 2004 @@ -574,6 +574,10 @@ /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 End of Patch.