This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perlapi: Fix grammar
[perl5.git] / t / lib / warnings / gv
CommitLineData
599cee73
PM
1 gv.c AOK
2
3 Can't locate package %s for @%s::ISA
4 @ISA = qw(Fred); joe()
5
6 Use of inherited AUTOLOAD for non-method %s::%.*s() is deprecated
7 sub Other::AUTOLOAD { 1 } sub Other::fred {}
8 @ISA = qw(Other) ;
9 fred() ;
10
8ae1fe26 11 $# is no longer supported
9b332a20 12 $* is no longer supported
599cee73
PM
13
14 $a = ${"#"} ;
15 $a = ${"*"} ;
16
a15a3d9b
FC
17 ${^ENCODING} is no longer supported.
18
e5e43984
FC
19 Name "main::a" used only once: possible typo
20
0453d815
PM
21 Mandatory Warnings ALL TODO
22 ------------------
599cee73 23
34ee6772 24 Had to create %SVf unexpectedly [gv_fetchpv]
0453d815
PM
25 Attempt to free unreferenced glob pointers [gp_free]
26
599cee73
PM
27__END__
28# gv.c
f40a7154 29use warnings 'syntax' ;
599cee73
PM
30@ISA = qw(Fred); joe()
31EXPECT
32Can't locate package Fred for @main::ISA at - line 3.
33Undefined subroutine &main::joe called at - line 3.
34########
35# gv.c
f40a7154 36no warnings 'syntax' ;
0453d815
PM
37@ISA = qw(Fred); joe()
38EXPECT
39Undefined subroutine &main::joe called at - line 3.
40########
41# gv.c
599cee73
PM
42sub Other::AUTOLOAD { 1 } sub Other::fred {}
43@ISA = qw(Other) ;
4438c4b7 44use warnings 'deprecated' ;
599cee73 45fred() ;
9493dad1
RD
46my $x = \&barney;
47(bless[])->barney;
599cee73 48EXPECT
d9d53e86 49Use of inherited AUTOLOAD for non-method main::fred() is deprecated. This will be fatal in Perl 5.28 at - line 5.
599cee73
PM
50########
51# gv.c
34ee6772
BF
52use utf8;
53use open qw( :utf8 :std );
54sub Oᕞʀ::AUTOLOAD { 1 } sub Oᕞʀ::fᕃƌ {}
55@ISA = qw(Oᕞʀ) ;
56use warnings 'deprecated' ;
57fᕃƌ() ;
58EXPECT
d9d53e86 59Use of inherited AUTOLOAD for non-method main::fᕃƌ() is deprecated. This will be fatal in Perl 5.28 at - line 7.
34ee6772
BF
60########
61# gv.c
a678626e
A
62$a = ${"#"};
63$a = ${"*"};
64no warnings 'deprecated' ;
65$a = ${"#"};
66$a = ${"*"};
67EXPECT
37398dc1
A
68$# is no longer supported. Its use will be fatal in Perl 5.30 at - line 2.
69$* is no longer supported. Its use will be fatal in Perl 5.30 at - line 3.
a678626e
A
70########
71# gv.c
72$a = ${#};
73$a = ${*};
74no warnings 'deprecated' ;
75$a = ${#};
76$a = ${*};
77EXPECT
37398dc1
A
78$# is no longer supported. Its use will be fatal in Perl 5.30 at - line 2.
79$* is no longer supported. Its use will be fatal in Perl 5.30 at - line 3.
a678626e
A
80########
81# gv.c
82$a = $#;
83$a = $*;
84$# = $a;
85$* = $a;
86$a = \$#;
87$a = \$*;
88no warnings 'deprecated' ;
89$a = $#;
90$a = $*;
91$# = $a;
92$* = $a;
93$a = \$#;
94$a = \$*;
95EXPECT
37398dc1
A
96$# is no longer supported. Its use will be fatal in Perl 5.30 at - line 2.
97$* is no longer supported. Its use will be fatal in Perl 5.30 at - line 3.
98$# is no longer supported. Its use will be fatal in Perl 5.30 at - line 4.
99$* is no longer supported. Its use will be fatal in Perl 5.30 at - line 5.
100$# is no longer supported. Its use will be fatal in Perl 5.30 at - line 6.
101$* is no longer supported. Its use will be fatal in Perl 5.30 at - line 7.
a678626e
A
102########
103# gv.c
104@a = @#;
105@a = @*;
106$a = $#;
107$a = $*;
108EXPECT
37398dc1
A
109$# is no longer supported. Its use will be fatal in Perl 5.30 at - line 4.
110$* is no longer supported. Its use will be fatal in Perl 5.30 at - line 5.
a678626e
A
111########
112# gv.c
113$a = $#;
114$a = $*;
115@a = @#;
116@a = @*;
117EXPECT
37398dc1
A
118$# is no longer supported. Its use will be fatal in Perl 5.30 at - line 2.
119$* is no longer supported. Its use will be fatal in Perl 5.30 at - line 3.
a678626e
A
120########
121# gv.c
a15a3d9b
FC
122$a = ${^ENCODING};
123$a = ${^E_NCODING};
124${^ENCODING} = 1;
125${^E_NCODING} = 1; # We pretend this variable never existed.
126EXPECT
ac641426 127${^ENCODING} is no longer supported. Its use will be fatal in Perl 5.28 at - line 4.
a15a3d9b
FC
128########
129# gv.c
34ee6772
BF
130use warnings 'syntax' ;
131use utf8;
132use open qw( :utf8 :std );
133package Y;
134@ISA = qw(Fred); joe()
135EXPECT
136Can't locate package Fred for @Y::ISA at - line 6.
137Undefined subroutine &Y::joe called at - line 6.
e5e43984
FC
138########
139# gv.c
140use warnings;
141$x = 1;
142if ($x) {
143 print $y;
144}
ea238638
FC
145$a++; # These two should
146$b++; # be exempt.
147$Foo::a++;
148$Foo::b++;
e5e43984
FC
149EXPECT
150Name "main::y" used only once: possible typo at - line 5.
151Use of uninitialized value $y in print at - line 5.
152########
153# gv.c
154use warnings;
155$x = 1;
156if ($x) {
157 $x++;
158 print $y;
159}
160EXPECT
161Name "main::y" used only once: possible typo at - line 6.
162Use of uninitialized value $y in print at - line 6.
163########
164# gv.c
165use warnings;
166$x = 0;
167if ($x) {
168 print "1\n";
169} elsif (!$x) {
170 print $y;
171} else {
172 print "0\n";
173}
174EXPECT
175Name "main::y" used only once: possible typo at - line 7.
176Use of uninitialized value $y in print at - line 7.
177########
178# gv.c
179use warnings;
180$x = 0;
181if ($x) {
182 print "1\n";
183} elsif (!$x) {
184 $x++;
185 print $y;
186} else {
187 print "0\n";
188}
189EXPECT
190Name "main::y" used only once: possible typo at - line 8.
191Use of uninitialized value $y in print at - line 8.
192########
193# gv.c
194use utf8;
195use open qw( :utf8 :std );
196use warnings;
197$ㄒ = 1;
198if ($ㄒ) {
199 print $ʎ;
200}
201EXPECT
202Name "main::ʎ" used only once: possible typo at - line 7.
203Use of uninitialized value $ʎ in print at - line 7.
204########
205# gv.c
206use utf8;
207use open qw( :utf8 :std );
208use warnings;
209$ㄒ = 1;
210if ($ㄒ) {
211 $ㄒ++;
212 print $ʎ;
213}
214EXPECT
215Name "main::ʎ" used only once: possible typo at - line 8.
216Use of uninitialized value $ʎ in print at - line 8.
217########
218# gv.c
219use utf8;
220use open qw( :utf8 :std );
221use warnings;
222$ㄒ = 0;
223if ($ㄒ) {
224 print "1\n";
225} elsif (!$ㄒ) {
226 print $ʎ;
227} else {
228 print "0\n";
229}
230EXPECT
231Name "main::ʎ" used only once: possible typo at - line 9.
232Use of uninitialized value $ʎ in print at - line 9.
233########
234# gv.c
235use utf8;
236use open qw( :utf8 :std );
237use warnings;
238$ㄒ = 0;
239if ($ㄒ) {
240 print "1\n";
241} elsif (!$ㄒ) {
242 $ㄒ++;
243 print $ʎ;
244} else {
245 print "0\n";
246}
247EXPECT
248Name "main::ʎ" used only once: possible typo at - line 10.
249Use of uninitialized value $ʎ in print at - line 10.
250########
251# gv.c
252use utf8;
253use open qw( :utf8 :std );
254use warnings;
255package 팣칵ぇ;
256$ㄒ = 1;
257if ($ㄒ) {
258 print $ʎ;
259}
260EXPECT
261Name "팣칵ぇ::ʎ" used only once: possible typo at - line 8.
262Use of uninitialized value $팣칵ぇ::ʎ in print at - line 8.
263########
264# gv.c
265use utf8;
266use open qw( :utf8 :std );
267use warnings;
268package 팣칵ぇ;
269$ㄒ = 1;
270if ($ㄒ) {
271 $ㄒ++;
272 print $ʎ;
273}
274EXPECT
275Name "팣칵ぇ::ʎ" used only once: possible typo at - line 9.
276Use of uninitialized value $팣칵ぇ::ʎ in print at - line 9.
277########
278# gv.c
279use utf8;
280use open qw( :utf8 :std );
281use warnings;
282package 팣칵ぇ;
283$ㄒ = 0;
284if ($ㄒ) {
285 print "1\n";
286} elsif (!$ㄒ) {
287 print $ʎ;
288} else {
289 print "0\n";
290}
291EXPECT
292Name "팣칵ぇ::ʎ" used only once: possible typo at - line 10.
293Use of uninitialized value $팣칵ぇ::ʎ in print at - line 10.
294########
295# gv.c
296use utf8;
297use open qw( :utf8 :std );
298use warnings;
299package 팣칵ぇ;
300$ㄒ = 0;
301if ($ㄒ) {
302 print "1\n";
303} elsif (!$ㄒ) {
304 $ㄒ++;
305 print $ʎ;
306} else {
307 print "0\n";
308}
309EXPECT
310Name "팣칵ぇ::ʎ" used only once: possible typo at - line 11.
311Use of uninitialized value $팣칵ぇ::ʎ in print at - line 11.