summaryrefslogtreecommitdiff
path: root/pod/perlvar.pod
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-01-02 23:14:37 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-01-02 23:48:33 -0800
commitac0650a4c9f69cdc9e7af31df29011c42b42b770 (patch)
treed87268aa928df04f0b056297e30607f119f02827 /pod/perlvar.pod
parent7f7845e39607487538cdd05d965d2677565da5d4 (diff)
downloadperl-ac0650a4c9f69cdc9e7af31df29011c42b42b770.tar.gz
Restore the old description of $[
The new entry is a bit too futuristic: assignment to $[ still works and it is not read-only. This does not fully restore the old description, as it contained grammatical errors and parts of it were not updated when 5.10 changed the scoping.
Diffstat (limited to 'pod/perlvar.pod')
-rw-r--r--pod/perlvar.pod18
1 files changed, 13 insertions, 5 deletions
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index 1dff9ce190..22c4477b97 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -2067,13 +2067,21 @@ Removed in Perl 5.10.
X<$[> X<$ARRAY_BASE>
This variable stores the index of the first element in an array, and
-of the first character in a substring. You used to be able to assign to
-this variable, but you can't do that anymore. It's now always 0, like
-it should be.
+of the first character in a substring. The default is 0, but you could
+theoretically set it to 1 to make Perl behave more like B<awk> (or Fortran)
+when subscripting and when evaluating the index() and substr() functions.
-Mnemonic: [ begins subscripts.
+As of release 5 of Perl, assignment to C<$[> is treated as a compiler
+directive, and cannot influence the behavior of any other file.
+(That's why you can only assign compile-time constants to it.)
+Its use is highly discouraged.
-This variable is read-only.
+Prior to Perl 5.10, 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.
+
+Mnemonic: [ begins subscripts.
Deprecated in Perl 5.12.