File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1255,11 +1255,13 @@ is very simple: define your own C<$/> inside the scope where you are
1255
1255
doing the matching. For example, taking a source of text, running
1256
1256
a regex on it, and map that to a hash using parallel execution:
1257
1257
1258
- my %mapped = @source.race.map: {
1259
- my $/; # need one in this block to prevent racing issues
1260
- m/foo (.*?) bar (.*)/; # matches on $_, stores in $/
1261
- $0 => $1 # short for $/[0] / $/[1]
1262
- }
1258
+ = begin code :preamble<my @source>
1259
+ my %mapped = @source.race.map: {
1260
+ my $/; # need one in this block to prevent racing issues
1261
+ m/foo (.*?) bar (.*)/; # matches on $_, stores in $/
1262
+ $0 => $1 # short for $/[0] / $/[1]
1263
+ }
1264
+ = end code
1263
1265
1264
1266
X < |error variable >
1265
1267
= head3 The C < $! > variable
You can’t perform that action at this time.
0 commit comments