Skip to content

Commit d5f5207

Browse files
committed
remove autodeclaration fossil from regex
1 parent 907649f commit d5f5207

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

S05-regex.pod

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Synopsis 5: Regexes and Rules
1717

1818
Created: 24 Jun 2002
1919

20-
Last Modified: 29 Dec 2011
21-
Version: 152
20+
Last Modified: 25 Feb 2012
21+
Version: 153
2222

2323
This document summarizes Apocalypse 5, which is about the new regex
2424
syntax. We now try to call them I<regex> rather than "regular
@@ -1204,17 +1204,12 @@ the lexical scope; if the match succeeds they are remembered in the
12041204
C<Match> object's hash, with a key corresponding to the variable name's
12051205
identifier. Likewise bound numeric variables persist as C<$0>, etc.
12061206

1207-
The capture performed by C<=> creates a new lexical variable if it does
1208-
not already exist in the current lexical scope. To capture to an outer
1209-
lexical variable you must supply an C<OUTER::> as part of the name,
1210-
or perform the assignment from within a closure.
1207+
You may capture to existing lexical variables; such variables may
1208+
already be visible from an outer scope, or may be declared within
1209+
the regex via a C<:my> declaration.
12111210

1212-
$x = [...] # capture to our own lexical $x
1213-
$OUTER::x = [...] # capture to existing lexical $x
1214-
[...] -> $tmp { let $x = $tmp } # capture to existing lexical $x
1215-
1216-
Note however that C<let> (and C<temp>) are not guaranteed to be thread
1217-
safe on shared variables, so don't do that.
1211+
my $x; / $x = [...] / # capture to outer lexical $x
1212+
/ :my $x; $x = [...] / # capture to our own lexical $x
12181213

12191214
=item *
12201215

0 commit comments

Comments
 (0)