1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
use warnings; no warnings 'deprecated';
use strict;
use Test::More tests => 14;
our @t = qw(a b c d e f);
is $t[3], "d";
$[ = 3;
is $t[3], "a";
{
is $t[3], "a";
$[ = -1;
is $t[3], "e";
$[ = +0;
is $t[3], "d";
$[ = +1;
is $t[3], "c";
$[ = 0;
is $t[3], "d";
}
is $t[3], "a";
{
local $[ = -1;
is $t[3], "e";
}
is $t[3], "a";
{
($[) = -1;
is $t[3], "e";
}
is $t[3], "a";
use t::scope_0;
is scope0_test(), "d";
is eval(q{
$[ = 3;
BEGIN { my $x = "foo\x{666}"; $x =~ /foo\p{Alnum}/; }
$t[3];
}), "a";
1;
|