PL_eval_start = 0;
else {
if (!PL_madskills) { /* assignment to $[ is ignored when making a mad dump */
+ deprecate("assignment to $[");
op_free(o);
o = newSVOP(OP_CONST, 0, newSViv(CopARYBASE_get(&PL_compiling)));
o->op_private |= OPpCONST_ARYBASE;
(F) The "use" keyword is recognized and executed at compile time, and
returns no useful value. See L<perlmod>.
+=item Use of assignment to $[ is deprecated
+
+(D deprecated) The C<$[> variable (index of the first element in an array)
+is deprecated. See L<perlvar/"$[">.
+
=item Use of bare << to mean <<"" is deprecated
(D deprecated, W syntax) You are now encouraged to use the explicitly quoted
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.
+(That's why you can only assign compile-time constants to it.) Its
+use is deprecated, and will trigger a warning (if the deprecation
+L<warnings> category is enabled. You did C<use warnings>, right?)
Note that, unlike other compile-time directives (such as L<strict>),
assignment to C<$[> can be seen from outer lexical scopes in the same file.
Deprecated use of my() in false conditional at - line 7.
Deprecated use of my() in false conditional at - line 8.
Deprecated use of my() in false conditional at - line 9.
+########
+# op.c
+$[ = 1;
+use warnings 'deprecated';
+$[ = 2;
+no warnings 'deprecated';
+$[ = 3;
+EXPECT
+Use of assignment to $[ is deprecated at - line 4.
-#!./perl -w
+#!./perl
BEGIN {
chdir 't' if -d 't';
require './test.pl';
}
use strict;
+use warnings;
+no warnings 'deprecated';
use vars qw(@array @r $k $v);
plan tests => 48;
-#!./perl -w
+#!./perl
#P = start of string Q = start of substr R = end of substr S = end of string
@INC = '../lib';
}
use warnings ;
+no warnings 'deprecated';
$a = 'abcdefxyz';
$SIG{__WARN__} = sub {