Skip to content

Commit c6819b4

Browse files
committed
pass example compilation test
1 parent 88c6847 commit c6819b4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/Language/variables.pod6

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,11 +1255,13 @@ is very simple: define your own C<$/> inside the scope where you are
12551255
doing the matching. For example, taking a source of text, running
12561256
a regex on it, and map that to a hash using parallel execution:
12571257
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
12631265
12641266
X<|error variable>
12651267
=head3 The C<$!> variable

0 commit comments

Comments
 (0)