This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlrecharclass: Fix typo
[perl5.git] / pod / perlvar.pod
index 17fd620..8561eb8 100644 (file)
@@ -14,7 +14,8 @@ C<::> or C<'>.  In this case, the part before the last C<::> or
 C<'> is taken to be a I<package qualifier>; see L<perlmod>.
 
 Perl variable names may also be a sequence of digits or a single
-punctuation or control character.  These names are all reserved for
+punctuation or control character (with the literal control character
+form deprecated).  These names are all reserved for
 special uses by Perl; for example, the all-digits names are used
 to hold data captured by backreferences after a regular expression
 match.  Perl has a special syntax for the single-control-character
@@ -370,19 +371,19 @@ X<$;> X<$SUBSEP> X<SUBSCRIPT_SEPARATOR>
 The subscript separator for multidimensional array emulation.  If you
 refer to a hash element as
 
-    $foo{$a,$b,$c}
+    $foo{$x,$y,$z}
 
 it really means
 
-    $foo{join($;, $a, $b, $c)}
+    $foo{join($;, $x, $y, $z)}
 
 But don't put
 
-    @foo{$a,$b,$c}     # a slice--note the @
+    @foo{$x,$y,$z}     # a slice--note the @
 
 which means
 
-    ($foo{$a},$foo{$b},$foo{$c})
+    ($foo{$x},$foo{$y},$foo{$z})
 
 Default is "\034", the same as SUBSEP in B<awk>.  If your keys contain
 binary data there might not be any safe value for C<$;>.
@@ -922,7 +923,7 @@ to return a defined value when the pattern was compiled or executed with
 the C</p> modifier.  In Perl v5.20, the C</p> modifier does nothing, so
 C<${^PREMATCH}> does the same thing as C<$PREMATCH>.
 
-This variable was added in Perl v5.10.0
+This variable was added in Perl v5.10.0.
 
 This variable is read-only and dynamically-scoped.
 
@@ -1404,7 +1405,12 @@ not reading from a record-oriented file (or your OS doesn't have
 record-oriented files), then you'll likely get a full chunk of data
 with every read.  If a record is larger than the record size you've
 set, you'll get the record back in pieces.  Trying to set the record
-size to zero or less will cause reading in the (rest of the) whole file.
+size to zero or less is deprecated and will cause $/ to have the value
+of "undef", which will cause reading in the (rest of the) whole file.
+
+As of 5.19.9 setting C<$/> to any other form of reference will throw a
+fatal exception. This is in preparation for supporting new ways to set
+C<$/> in the future.
 
 On VMS only, record reads bypass PerlIO layers and any associated
 buffering, so you must not mix record and non-record reads on the
@@ -1865,10 +1871,34 @@ Mnemonic: value of B<-D> switch.
 =item ${^ENCODING}
 X<${^ENCODING}>
 
+DEPRECATED!!!
+
 The I<object reference> to the C<Encode> object that is used to convert
 the source code to Unicode.  Thanks to this variable your Perl script
-does not have to be written in UTF-8.  Default is I<undef>.  The direct
-manipulation of this variable is highly discouraged.
+does not have to be written in UTF-8.  Default is C<undef>.
+
+Setting this variable to any other value than C<undef> is deprecated due
+to fundamental defects in its design and implementation.  It is planned
+to remove it from a future Perl version.  Its purpose was to allow your
+non-ASCII Perl scripts to not have to be written in UTF-8; this was
+useful before editors that worked on UTF-8 encoded text were common, but
+that was long ago.  It causes problems, such as affecting the operation
+of other modules that aren't expecting it, causing general mayhem.  Its
+use can lead to segfaults.
+
+If you need something like this functionality, you should use the
+L<encoding> pragma, which is also deprecated, but has fewer nasty side
+effects.
+
+If you are coming here because code of yours is being adversely affected
+by someone's use of this variable, you can usually work around it by
+doing this:
+
+ local ${^ENCODING};
+
+near the beginning of the functions that are getting broken.  This
+undefines the variable during the scope of execution of the including
+function.
 
 This variable was added in Perl 5.8.2.
 
@@ -2033,7 +2063,9 @@ X<%^H>
 
 The C<%^H> hash provides the same scoping semantic as C<$^H>.  This makes
 it useful for implementation of lexically scoped pragmas.  See
-L<perlpragma>.
+L<perlpragma>.   All the entries are stringified when accessed at
+runtime, so only simple values can be accommodated.  This means no
+pointers to objects, for example.
 
 When putting items into C<%^H>, in order to avoid conflicting with other
 users of the hash there is a convention regarding which keys to use.
@@ -2109,6 +2141,14 @@ were compiled.
 
 Save source code lines into C<@{"_<$filename"}>.
 
+=item 0x800
+
+When saving source, include evals that generate no subroutines.
+
+=item 0x1000
+
+When saving source, include source that did not compile.
+
 =back
 
 Some bits may be relevant at compile-time only, some at
@@ -2240,10 +2280,10 @@ The version + patchlevel / 1000 of the Perl interpreter.  This variable
 can be used to determine whether the Perl interpreter executing a
 script is in the right range of versions:
 
-    warn "No checksumming!\n" if $] < 3.019;
+    warn "No PerlIO!\n" if $] lt '5.008';
 
 The floating point representation can sometimes lead to inaccurate
-numeric comparisons.
+numeric comparisons, so string comparisons are recommended.
 
 See also the documentation of C<use VERSION> and C<require VERSION>
 for a convenient way to fail if the running Perl interpreter is too old.