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
control-C<W>. This is better than typing a literal control-C<W>
into your program.
-Since Perl 5.6, Perl variable names may be alphanumeric
+Since Perl v5.6.0, Perl variable names may be alphanumeric
strings that begin with control characters (or better yet, a caret).
These variables must be written in the form C<${^Foo}>; the braces
are not optional. C<${^Foo}> denotes the scalar variable whose
at the top of your program. This aliases all the short names to the long
names in the current package. Some even have medium names, generally
-borrowed from B<awk>. To avoid a performance hit, if you don't need the
-C<$PREMATCH>, C<$MATCH>, or C<$POSTMATCH> it's best to use the C<English>
-module without them:
-
- use English '-no_match_vars';
+borrowed from B<awk>. For more info, please see L<English>.
Before you continue, note the sort order for variables. In general, we
first list the variables in case-insensitive, almost-lexigraphical
The following functions use C<$_> as a default argument:
abs, alarm, chomp, chop, chr, chroot,
-cos, defined, eval, evalbytes, exp, glob,
-hex, int, lc, lcfirst, length, log, lstat, mkdir, oct, ord, pos, print,
+cos, defined, eval, evalbytes, exp, fc, glob, hex, int, lc,
+lcfirst, length, log, lstat, mkdir, oct, ord, pos, print, printf,
quotemeta, readlink, readpipe, ref, require, reverse (in scalar context only),
-rmdir, sin, split (on its second argument), sqrt, stat, study, uc, ucfirst,
+rmdir, say, sin, split (for its second
+argument), sqrt, stat, study, uc, ucfirst,
unlink, unpack.
=item *
=item *
-The default place to put an input record when a C<< <FH> >>
+The default place to put the next value or input record
+when a C<< <FH> >>, C<readline>, C<readdir> or C<each>
operation's result is tested by itself as the sole criterion of a C<while>
test. Outside a C<while> test, this will not happen.
=back
-As C<$_> is a global variable, this may lead in some cases to unwanted
-side-effects. As of perl 5.10, you can now use a lexical version of
+C<$_> is by default a global variable. However, as
+of perl v5.10.0, you can use a lexical version of
C<$_> by declaring it in a file or in a block with C<my>. Moreover,
-declaring C<our $_> restores the global C<$_> in the current scope.
+declaring C<our $_> restores the global C<$_> in the current scope. Though
+this seemed like a good idea at the time it was introduced, lexical C<$_>
+actually causes more problems than it solves. If you call a function that
+expects to be passed information via C<$_>, it may or may not work,
+depending on how the function is written, there not being any easy way to
+solve this. Just avoid lexical C<$_>, unless you are feeling particularly
+masochistic. For this reason lexical C<$_> is still experimental and will
+produce a warning unless warnings have been disabled. As with other
+experimental features, the behavior of lexical C<$_> is subject to change
+without notice, including change into a fatal error.
Mnemonic: underline is understood in certain operations.
To see if your system is affected by this discrepancy check if
C<getconf GNU_LIBPTHREAD_VERSION | grep -q NPTL> returns a false
-value. NTPL threads preserve the POSIX semantics.
+value. NTPL threads preserve the POSIX semantics.
Mnemonic: same as shells.
If the program has been given to perl via the switches C<-e> or C<-E>,
C<$0> will contain the string C<"-e">.
-On Linux as of perl 5.14 the legacy process name will be set with
+On Linux as of perl v5.14.0 the legacy process name will be set with
C<prctl(2)>, in addition to altering the POSIX name via C<argv[0]> as
perl has done since version 4.000. Now system utilities that read the
legacy process name such as ps, top and killall will recognize the
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<$;>.
value in C<ENV> changes the environment for any child processes
you subsequently C<fork()> off.
+As of v5.18.0, both keys and values stored in C<%ENV> are stringified.
+
+ my $foo = 1;
+ $ENV{'bar'} = \$foo;
+ if( ref $ENV{'bar'} ) {
+ say "Pre 5.18.0 Behaviour";
+ } else {
+ say "Post 5.18.0 Behaviour";
+ }
+
+Previously, only child processes received stringified values:
+
+ my $foo = 1;
+ $ENV{'bar'} = \$foo;
+
+ # Always printed 'non ref'
+ system($^X, '-e',
+ q/print ( ref $ENV{'bar'} ? 'ref' : 'non ref' ) /);
+
+This happens because you can't really share arbitrary data structures with
+foreign processes.
+
=item $SYSTEM_FD_MAX
=item $^F
If your system has the C<sigaction()> function then signal handlers
are installed using it. This means you get reliable signal handling.
-The default delivery policy of signals changed in Perl 5.8.0 from
+The default delivery policy of signals changed in Perl v5.8.0 from
immediate (also known as "unsafe") to deferred, also known as "safe
signals". See L<perlipc> for more information.
The revision, version, and subversion of the Perl interpreter,
represented as a C<version> object.
-This variable first appeared in perl 5.6.0; earlier versions of perl
-will see an undefined value. Before perl 5.10.0 C<$^V> was represented
+This variable first appeared in perl v5.6.0; earlier versions of perl
+will see an undefined value. Before perl v5.10.0 C<$^V> was represented
as a v-string.
C<$^V> can be used to determine whether the Perl interpreter executing
See also C<$]> for an older representation of the Perl version.
-This variable was added in Perl 5.6.
+This variable was added in Perl v5.6.0.
Mnemonic: use ^V for Version Control.
L<perlrun|perlrun/"Command Switches"> for more information about site
customization.
-This variable was added in Perl 5.10.
+This variable was added in Perl v5.10.0.
=item $EXECUTABLE_NAME
$1 is Mutt; $2 is Jeff
$1 is Wallace; $2 is Grommit
-Due to an unfortunate accident of Perl's implementation, C<use
-English> imposes a considerable performance penalty on all regular
-expression matches in a program because it uses the C<$`>, C<$&>, and
-C<$'>, regardless of whether they occur in the scope of C<use
-English>. For that reason, saying C<use English> in libraries is
-strongly discouraged unless you import it without the match variables:
+=head3 Performance issues
+
+Traditionally in Perl, any use of any of the three variables C<$`>, C<$&>
+or C<$'> (or their C<use English> equivalents) anywhere in the code, caused
+all subsequent successful pattern matches to make a copy of the matched
+string, in case the code might subsequently access one of those variables.
+This imposed a considerable performance penalty across the whole program,
+so generally the use of these variables has been discouraged.
+
+In Perl 5.6.0 the C<@-> and C<@+> dynamic arrays were introduced that
+supply the indices of successful matches. So you could for example do
+this:
+
+ $str =~ /pattern/;
+
+ print $`, $&, $'; # bad: perfomance hit
- use English '-no_match_vars'
+ print # good: no perfomance hit
+ substr($str, 0, $-[0]),
+ substr($str, $-[0], $+[0]-$-[0]),
+ substr($str, $+[0]);
-The C<Devel::NYTProf> and C<Devel::FindAmpersand>
-modules can help you find uses of these
-problematic match variables in your code.
+In Perl 5.10.0 the C</p> match operator flag and the C<${^PREMATCH}>,
+C<${^MATCH}>, and C<${^POSTMATCH}> variables were introduced, that allowed
+you to suffer the penalties only on patterns marked with C</p>.
-Since Perl 5.10, you can use the C</p> match operator flag and the
-C<${^PREMATCH}>, C<${^MATCH}>, and C<${^POSTMATCH}> variables instead
-so you only suffer the performance penalties.
+In Perl 5.18.0 onwards, perl started noting the presence of each of the
+three variables separately, and only copied that part of the string
+required; so in
+
+ $`; $&; "abcdefgh" =~ /d/
+
+perl would only copy the "abcd" part of the string. That could make a big
+difference in something like
+
+ $str = 'x' x 1_000_000;
+ $&; # whoops
+ $str =~ /x/g # one char copied a million times, not a million chars
+
+In Perl 5.20.0 a new copy-on-write system was enabled by default, which
+finally fixes all performance issues with these three variables, and makes
+them safe to use anywhere.
+
+The C<Devel::NYTProf> and C<Devel::FindAmpersand> modules can help you
+find uses of these problematic match variables in your code.
=over 8
any matches hidden within a BLOCK or C<eval()> enclosed by the current
BLOCK).
-The use of this variable anywhere in a program imposes a considerable
-performance penalty on all regular expression matches. To avoid this
-penalty, you can extract the same substring by using L</@->. Starting
-with Perl 5.10, you can use the C</p> match flag and the C<${^MATCH}>
-variable to do the same thing for particular match operations.
+See L</Performance issues> above for the serious performance implications
+of using this variable (even once) in your code.
This variable is read-only and dynamically-scoped.
X<${^MATCH}>
This is similar to C<$&> (C<$MATCH>) except that it does not incur the
-performance penalty associated with that variable, and is only guaranteed
+performance penalty associated with that variable.
+
+See L</Performance issues> above.
+
+In Perl v5.18 and earlier, it is only guaranteed
to return a defined value when the pattern was compiled or executed with
-the C</p> modifier.
+the C</p> modifier. In Perl v5.20, the C</p> modifier does nothing, so
+C<${^MATCH}> does the same thing as C<$MATCH>.
-This variable was added in Perl 5.10.
+This variable was added in Perl v5.10.0.
This variable is read-only and dynamically-scoped.
pattern match, not counting any matches hidden within a BLOCK or C<eval>
enclosed by the current BLOCK.
-The use of this variable anywhere in a program imposes a considerable
-performance penalty on all regular expression matches. To avoid this
-penalty, you can extract the same substring by using L</@->. Starting
-with Perl 5.10, you can use the C</p> match flag and the
-C<${^PREMATCH}> variable to do the same thing for particular match
-operations.
+See L</Performance issues> above for the serious performance implications
+of using this variable (even once) in your code.
This variable is read-only and dynamically-scoped.
X<$`> X<${^PREMATCH}>
This is similar to C<$`> ($PREMATCH) except that it does not incur the
-performance penalty associated with that variable, and is only guaranteed
+performance penalty associated with that variable.
+
+See L</Performance issues> above.
+
+In Perl v5.18 and earlier, it is only guaranteed
to return a defined value when the pattern was compiled or executed with
-the C</p> modifier.
+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 5.10
+This variable was added in Perl v5.10.0.
This variable is read-only and dynamically-scoped.
/def/;
print "$`:$&:$'\n"; # prints abc:def:ghi
-The use of this variable anywhere in a program imposes a considerable
-performance penalty on all regular expression matches.
-To avoid this penalty, you can extract the same substring by
-using L</@->. Starting with Perl 5.10, you can use the C</p> match flag
-and the C<${^POSTMATCH}> variable to do the same thing for particular
-match operations.
+See L</Performance issues> above for the serious performance implications
+of using this variable (even once) in your code.
This variable is read-only and dynamically-scoped.
X<${^POSTMATCH}> X<$'> X<$POSTMATCH>
This is similar to C<$'> (C<$POSTMATCH>) except that it does not incur the
-performance penalty associated with that variable, and is only guaranteed
+performance penalty associated with that variable.
+
+See L</Performance issues> above.
+
+In Perl v5.18 and earlier, it is only guaranteed
to return a defined value when the pattern was compiled or executed with
-the C</p> modifier.
+the C</p> modifier. In Perl v5.20, the C</p> modifier does nothing, so
+C<${^POSTMATCH}> does the same thing as C<$POSTMATCH>.
-This variable was added in Perl 5.10.
+This variable was added in Perl v5.10.0.
This variable is read-only and dynamically-scoped.
By setting and then using C<$var> in this way relieves you from having to
worry about exactly which numbered set of parentheses they are.
-This variable was added in Perl 5.8.
+This variable was added in Perl v5.8.0.
Mnemonic: the (possibly) Nested parenthesis that most recently closed.
how many subgroups were in the last successful match. See the
examples given for the C<@-> variable.
-This variable was added in Perl 5.6.
+This variable was added in Perl v5.6.0.
=item %LAST_PAREN_MATCH
Likewise, if the last successful match changes, then the results may be
surprising.
-This variable was added in Perl 5.10.
+This variable was added in Perl v5.10.0.
This variable is read-only and dynamically-scoped.
=back
-This variable was added in Perl 5.6.
+This variable was added in Perl v5.6.0.
=item %LAST_MATCH_START
Likewise, if the last successful match changes, then the results may be
surprising.
-This variable was added in Perl 5.10
+This variable was added in Perl v5.10.0.
This variable is read-only and dynamically-scoped.
The current value of the regex debugging flags. Set to 0 for no debug output
even when the C<re 'debug'> module is loaded. See L<re> for details.
-This variable was added in Perl 5.10.
+This variable was added in Perl v5.10.0.
=item ${^RE_TRIE_MAXBUF}
X<${^RE_TRIE_MAXBUF}>
negative value to prevent the optimisation and conserve the most memory.
Under normal situations this variable should be of no interest to you.
-This variable was added in Perl 5.10.
+This variable was added in Perl v5.10.0.
=back
to do a lot of inserting and don't want to keep modifying C<$_>. See
L<perlrun> for the B<-i> switch.
-=item Handle->output_field_separator( EXPR )
+=item IO::Handle->output_field_separator( EXPR )
=item $OUTPUT_FIELD_SEPARATOR
The output field separator for the print operator. If defined, this
value is printed between each of print's arguments. Default is C<undef>.
+You cannot call C<output_field_separator()> on a handle, only as a
+static method. See L<IO::Handle|IO::Handle>.
+
Mnemonic: what is printed when there is a "," in your print statement.
=item HANDLE->input_line_number( EXPR )
Mnemonic: many programs use "." to mean the current line number.
-=item HANDLE->input_record_separator( EXPR )
+=item IO::Handle->input_record_separator( EXPR )
=item $INPUT_RECORD_SEPARATOR
Setting C<$/> to a reference to an integer, scalar containing an
integer, or scalar that's convertible to an integer will attempt to
read records instead of lines, with the maximum record size being the
-referenced integer. So this:
+referenced integer number of characters. So this:
local $/ = \32768; # or \"32768", or \$var_containing_32768
open my $fh, "<", $myfile or die $!;
local $_ = <$fh>;
-will read a record of no more than 32768 bytes from FILE. If you're
+will read a record of no more than 32768 characters from $fh. If you're
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
+buffering, so you must not mix record and non-record reads on the
same filehandle. Record mode mixes with line mode only when the
same buffering layer is in use for both modes.
-If you perform a record read on a FILE with an encoding layer such as
-C<:encoding(latin1)> or C<:utf8>, you may get an invalid string as a
-result, may leave the FILE positioned between characters in the stream
-and may not be reading the number of bytes from the underlying file
-that you specified. This behaviour may change without warning in a
-future version of perl.
+You cannot call C<input_record_separator()> on a handle, only as a
+static method. See L<IO::Handle|IO::Handle>.
-See also L<perlport/"Newlines">. Also see L</$.>.
+See also L<perlport/"Newlines">. Also see L</$.>.
Mnemonic: / delimits line boundaries when quoting poetry.
-=item Handle->output_record_separator( EXPR )
+=item IO::Handle->output_record_separator( EXPR )
=item $OUTPUT_RECORD_SEPARATOR
The output record separator for the print operator. If defined, this
value is printed after the last of print's arguments. Default is C<undef>.
+You cannot call C<output_record_separator()> on a handle, only as a
+static method. See L<IO::Handle|IO::Handle>.
+
Mnemonic: you set C<$\> instead of adding "\n" at the end of the print.
Also, it's just like C<$/>, but it's what you get "back" from Perl.
Mnemonic: when you want your pipes to be piping hot.
+=item ${^LAST_FH}
+X<${^LAST_FH}>
+
+This read-only variable contains a reference to the last-read filehandle.
+This is set by C<< <HANDLE> >>, C<readline>, C<tell>, C<eof> and C<seek>.
+This is the same handle that C<$.> and C<tell> and C<eof> without arguments
+use. It is also the handle used when Perl appends ", <STDIN> line 1" to
+an error or warning message.
+
+This variable was added in Perl v5.18.0.
+
=back
=head3 Variables related to formats
unless you call C<formline()> yourself and then look at it. See
L<perlform> and L<perlfunc/"formline PICTURE,LIST">.
-=item HANDLE->format_formfeed(EXPR)
+=item IO::Handle->format_formfeed(EXPR)
=item $FORMAT_FORMFEED
What formats output as a form feed. The default is C<\f>.
+You cannot call C<format_formfeed()> on a handle, only as a static
+method. See L<IO::Handle|IO::Handle>.
+
=item HANDLE->format_page_number(EXPR)
=item $FORMAT_PAGE_NUMBER
Mnemonic: lines_on_page - lines_printed.
-=item Handle->format_line_break_characters EXPR
+=item IO::Handle->format_line_break_characters EXPR
=item $FORMAT_LINE_BREAK_CHARACTERS
fill continuation fields (starting with C<^>) in a format. The default is
S<" \n-">, to break on a space, newline, or a hyphen.
+You cannot call C<format_line_break_characters()> on a handle, only as
+a static method. See L<IO::Handle|IO::Handle>.
+
Mnemonic: a "colon" in poetry is a part of a line.
=item HANDLE->format_lines_per_page(EXPR)
Under VMS this reflects the actual VMS exit status; i.e. it is the
same as C<$?> when the pragma C<use vmsish 'status'> is in effect.
-This variable was added in Perl 5.8.9.
+This variable was added in Perl v5.10.0.
=item $EXTENDED_OS_ERROR
Current state of the interpreter.
$^S State
- --------- -------------------
- undef Parsing module/eval
+ --------- -------------------------------------
+ undef Parsing module, eval, or main program
true (1) Executing an eval
false (0) Otherwise
The first state may happen in C<$SIG{__DIE__}> and C<$SIG{__WARN__}>
handlers.
+The English name $EXCEPTIONS_BEING_CAUGHT is slightly misleading, because
+the C<undef> value does not indicate whether exceptions are being caught,
+since compilation of the main program does not catch exceptions.
+
This variable was added in Perl 5.004.
=item $WARNING
values are considered internal to the L<warnings> pragma and may change
between versions of Perl.
-This variable was added in Perl 5.6.
+This variable was added in Perl v5.6.0.
=item $OS_ERROR
time rather than normal, deferred loading. Setting
C<$^C = 1> is similar to calling C<B::minus_c>.
-This variable was added in Perl 5.6.
+This variable was added in Perl v5.6.0.
=item $DEBUGGING
=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.
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.
name of its main package) and a "/" character. For example, a module
C<Foo::Bar> should use keys such as C<Foo::Bar/baz>.
-This variable was added in Perl 5.6.
+This variable was added in Perl v5.6.0.
=item ${^OPEN}
X<${^OPEN}>
by a C<\0> byte, the first part describes the input layers, the second
part describes the output layers.
-This variable was added in Perl 5.8.0.
+This variable was added in Perl v5.8.0.
=item $PERLDB
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
This variable is read-only.
-This variable was added in Perl 5.8.
+This variable was added in Perl v5.8.0.
=item ${^UNICODE}
X<${^UNICODE}>
This variable is set during Perl startup and is thereafter read-only.
-This variable was added in Perl 5.8.2.
+This variable was added in Perl v5.8.2.
=item ${^UTF8CACHE}
X<${^UTF8CACHE}>
1 for on (the default), 0 for off, -1 to debug the caching code by checking
all its results against linear scans, and panicking on any discrepancy.
-This variable was added in Perl 5.8.9.
+This variable was added in Perl v5.8.9. It is subject to change or
+removal without notice, but is currently used to avoid recalculating the
+boundaries of multi-byte UTF-8-encoded characters.
=item ${^UTF8LOCALE}
X<${^UTF8LOCALE}>
adjust-utf8ness-to-locale mode (as when run with the C<-CL> command-line
switch); see L<perlrun> for more info on this.
-This variable was added in Perl 5.8.8.
+This variable was added in Perl v5.8.8.
=back
=over 8
-=item $OFMT
-
=item $#
-X<$#> X<$OFMT>
+X<$#>
C<$#> was a variable that could be used to format printed numbers.
-After a deprecation cycle, its magic was removed in Perl 5.10 and
+After a deprecation cycle, its magic was removed in Perl v5.10.0 and
using it now triggers a warning: C<$# is no longer supported>.
This is not the sigil you use in front of an array name to get the
Deprecated in Perl 5.
-Removed in Perl 5.10.
+Removed in Perl v5.10.0.
=item $*
X<$*>
C<$*> was a variable that you could use to enable multiline matching.
-After a deprecation cycle, its magic was removed in Perl 5.10.
+After a deprecation cycle, its magic was removed in Perl v5.10.0.
Using it now triggers a warning: C<$* is no longer supported>.
You should use the C</s> and C</m> regexp modifiers instead.
Deprecated in Perl 5.
-Removed in Perl 5.10.
-
-=item $ARRAY_BASE
+Removed in Perl v5.10.0.
=item $[
-X<$[> X<$ARRAY_BASE>
+X<$[>
This variable stores the index of the first element in an array, and
of the first character in a substring. The default is 0, but you could
(That's why you can only assign compile-time constants to it.)
Its use is highly discouraged.
-Prior to Perl 5.10, assignment to C<$[> could be seen from outer lexical
+Prior to Perl v5.10.0, assignment to C<$[> could be seen from outer lexical
scopes in the same file, unlike other compile-time directives (such as
L<strict>). Using local() on it would bind its value strictly to a lexical
block. Now it is always lexically scoped.
-As of Perl 5.16, it is implemented by the L<arybase> module. See
+As of Perl v5.16.0, it is implemented by the L<arybase> module. See
L<arybase> for more details on its behaviour.
Under C<use v5.16>, or C<no feature "array_base">, C<$[> no longer has any
Mnemonic: [ begins subscripts.
-Deprecated in Perl 5.12.
-
-=item $OLD_PERL_VERSION
+Deprecated in Perl v5.12.0.
=item $]
-X<$]> X<$OLD_PERL_VERSION>
+X<$]>
See L</$^V> for a more modern representation of the Perl version that allows
accurate string comparisons.
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.