if (ab_op_is_dollar_bracket(left) && right->op_type == OP_CONST) {
set_arybase_to(SvIV(cSVOPx_sv(right)));
ab_neuter_dollar_bracket(left);
+ Perl_ck_warner_d(aTHX_
+ packWARN(WARN_DEPRECATED), "Use of assignment to $[ is deprecated"
+ );
}
}
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
BEGIN {
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 33;
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
BEGIN {
# Basic tests for $[ as a variable
# plus miscellaneous bug fix tests
+no warnings 'deprecated';
use Test::More tests => 7;
sub outside_base_scope { return "${'['}" }
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 18;
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 8;
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 12;
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 11;
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 12;
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 14;
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 23;
-use warnings;
+use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 6;
(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) You are now encouraged to use the explicitly quoted
Deprecated use of my() in false conditional at - line 8.
########
# op.c
+$[ = 1;
+($[) = 1;
+use warnings 'deprecated';
+$[ = 2;
+($[) = 2;
+no warnings 'deprecated';
+$[ = 3;
+($[) = 3;
+EXPECT
+Use of assignment to $[ is deprecated at - line 2.
+Use of assignment to $[ is deprecated at - line 3.
+Use of assignment to $[ is deprecated at - line 5.
+Use of assignment to $[ is deprecated at - line 6.
+########
+# op.c
use warnings 'void';
@x = split /y/, "z";
$x = split /y/, "z";
#!perl -w
use strict;
+no warnings 'deprecated';
BEGIN {
require './test.pl';