This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add thread-safe locale handling
[perl5.git] / pod / perlvar.pod
index b8c68b3..06d1ef9 100644 (file)
@@ -503,9 +503,10 @@ initially consists of the arguments to any B<-I> command-line
 switches, followed by the default Perl library, probably
 F</usr/local/lib/perl>, followed by ".", to represent the current
 directory.  ("." will not be appended if taint checks are enabled,
-either by C<-T> or by C<-t>.)  If you need to modify this at runtime,
-you should use the C<use lib> pragma to get the machine-dependent
-library properly loaded also:
+either by C<-T> or by C<-t>, or if configured not to do so by the
+C<-Ddefault_inc_excludes_dot> compile time option.)  If you need to
+modify this at runtime, you should use the C<use lib> pragma to get
+the machine-dependent library properly loaded also:
 
     use lib '/mypath/libdir/';
     use SomeMod;
@@ -924,8 +925,8 @@ Mnemonic: like \digits.
 =item @{^CAPTURE}
 X<@{^CAPTURE}> X<@^CAPTURE>
 
-An array which contains the capture buffers, if any, of the last
-successful pattern match, not counting patterns matched
+An array which exposes the contents of the capture buffers, if any, of
+the last successful pattern match, not counting patterns matched
 in nested blocks that have been exited already.
 
 Note that the 0 index of @{^CAPTURE} is equivalent to $1, the 1 index
@@ -939,6 +940,9 @@ should output "f-o-a-l".
 
 See also L</$I<digits>>, L</%{^CAPTURE}> and L</%{^CAPTURE_ALL}>.
 
+Note that unlike most other regex magic variables there is no single
+letter equivalent to C<@{^CAPTURE}>.
+
 This variable was added in 5.25.7
 
 =item $MATCH
@@ -1117,6 +1121,9 @@ For example, C<$+{foo}> is equivalent to C<$1> after the following match:
 The keys of the C<%+> hash list only the names of buffers that have
 captured (and that are thus associated to defined values).
 
+If multiple distinct capture groups have the same name, then
+C<$+{NAME}> will refer to the leftmost defined group in the match.
+
 The underlying behaviour of C<%+> is provided by the
 L<Tie::Hash::NamedCapture> module.
 
@@ -1986,6 +1993,7 @@ undefines the variable during the scope of execution of the including
 function.
 
 This variable was added in Perl 5.8.2 and removed in 5.26.0.
+Setting it to anything other than C<undef> was made fatal in Perl 5.28.0.
 
 =item ${^GLOBAL_PHASE}
 X<${^GLOBAL_PHASE}>
@@ -2251,6 +2259,21 @@ This variable is read-only.
 
 This variable was added in Perl v5.8.0.
 
+=item ${^SAFE_LOCALES}
+X<${^SAFE_LOCALES}>
+
+Reflects if safe locale operations are available to this perl (when the
+value is 1) or not (the value is 0).  This variable is always 1 if the
+perl has been compiled without threads.  It is also 1 if this perl is
+using thread-safe locale operations.  Note that an individual thread may
+choose to use the global locale (generally unsafe) by calling
+C<switch_to_global_locale>.  This variable currently is still
+set to 1 in such threads.
+
+This variable is read-only.
+
+This variable was added in Perl v5.28.0.
+
 =item ${^UNICODE}
 X<${^UNICODE}>
 
@@ -2355,6 +2378,8 @@ Mnemonic: [ begins subscripts.
 
 Deprecated in Perl v5.12.0.
 
+Assigning a non-zero value be fatal in Perl v5.30.0.
+
 =back
 
 =cut