Skip to content
Browse files

disallow direct assignment to $/

  • Loading branch information...
1 parent fac7a1a commit 33d795b82909ebf68676906de44d7320732601b1 @TimToady TimToady committed Aug 21, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 S05-regex.pod
View
11 S05-regex.pod
@@ -16,8 +16,8 @@ Synopsis 5: Regexes and Rules
Created: 24 Jun 2002
- Last Modified: 12 May 2013
- Version: 164
+ Last Modified: 21 Aug 2013
+ Version: 165
This document summarizes Apocalypse 5, which is about the new regex
syntax. We now try to call them I<regex> rather than "regular
@@ -69,6 +69,13 @@ C<$1>, etc.) are just elements of C<$/>.
By the way, unlike in Perl 5, the numbered capture variables now
start at C<$0> instead of C<$1>. See below.
+In order to detect accidental use of Perl 5's unrelated C<$/>
+variable, Perl 6's C<$/> variable may not be assigned to directly.
+
+ $/ = $x; # "Unsupported use of $/ variable as input record separator"
+ $/ := $x; # OK, binding
+ $/ RR= $x; # OK, metaoperator
+ ($/) = $x; # OK, list assignment
=head1 Unchanged syntactic features

0 comments on commit 33d795b

Please sign in to comment.
Something went wrong with that request. Please try again.