From e1dccc0d34a90e3511bfed596be9d78128ca7ee7 Mon Sep 17 00:00:00 2001 From: Zefram Date: Fri, 9 Sep 2011 23:27:16 +0100 Subject: remove index offsetting ($[) $[ remains as a variable. It no longer has compile-time magic. At runtime, it always reads as zero, accepts a write of zero, but dies on writing any other value. --- pod/perlvar.pod | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'pod/perlvar.pod') diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 890909d526..3217e3cc55 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -2071,25 +2071,17 @@ Removed in Perl 5.10. =item $[ X<$[> X<$ARRAY_BASE> -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 -theoretically set it to 1 to make Perl behave more like B (or Fortran) -when subscripting and when evaluating the index() and substr() functions. - -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. - -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). Using local() on it would bind its value strictly to a lexical -block. Now it is always lexically scoped. - -Mnemonic: [ begins subscripts. +C<$[> was a variable that you could use to offset the indexing of arrays +and strings. After a deprecation cycle, the feature was removed in +Perl 5.16. Two old ways of coping with the variability of the index +offset, which were rendered obsolete in Perl 5.000 when C<$[> became +effectively lexically scoped, are still supported: you can read it +(always yielding zero) and you can assign zero to it. Deprecated in Perl 5.12. +Removed in Perl 5.16. + =item $OLD_PERL_VERSION =item $] -- cgit v1.2.1