blob: bc00a484c6dfaab6088838258ef11833bf87c4e9 (
plain) (
blame)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
__END__
# NAME local %$ref on last line of lvalue sub in lv cx
sub foo :lvalue { local %{\%foo} }
(foo) = 3;
EXPECT
Can't localize through a reference at - line 1.
########
# NAME local @$ref on last line of lvalue sub in lv cx
sub foo :lvalue { local @{\@foo} }
(foo) = 3;
EXPECT
Can't localize through a reference at - line 1.
########
# NAME local %$ref on last line of lvalue sub in non-lv cx
sub foo :lvalue { local %{\%foo} }
foo;
EXPECT
Can't localize through a reference at - line 1.
########
# NAME local @$ref on last line of lvalue sub in non-lv cx
sub foo :lvalue { local @{\@foo} }
foo;
EXPECT
Can't localize through a reference at - line 1.
########
# NAME \local %$ref
\local %{\%hash}
EXPECT
Can't localize through a reference at - line 1.
########
# NAME \local @$ref
\local @{\@hash}
EXPECT
Can't localize through a reference at - line 1.
########
# NAME calling undef sub belonging to undef GV
my $foosub = \&foo;
undef *foo;
&$foosub;
EXPECT
Undefined subroutine &main::foo called at - line 3.
########
# NAME calling undef sub resident in its GV
my $foosub = \&foo;
&$foosub;
EXPECT
Undefined subroutine &main::foo called at - line 2.
########
# NAME calling undef scalar
&{+undef};
EXPECT
Can't use an undefined value as a subroutine reference at - line 1.
########
# NAME calling undef magical scalar
sub TIESCALAR {bless[]}
sub FETCH {}
tie $tied, "";
&$tied;
EXPECT
Can't use an undefined value as a subroutine reference at - line 4.
|