Commit | Line | Data |
---|---|---|
599cee73 PM |
1 | toke.c AOK |
2 | ||
3 | we seem to have lost a few ambiguous warnings!! | |
4 | ||
5 | ||
599cee73 PM |
6 | $a = <<; |
7 | Use of comma-less variable list is deprecated | |
8 | (called 3 times via depcom) | |
9 | ||
10 | \1 better written as $1 | |
4438c4b7 | 11 | use warnings 'syntax' ; |
599cee73 PM |
12 | s/(abc)/\1/; |
13 | ||
14 | warn(warn_nosemi) | |
15 | Semicolon seems to be missing | |
16 | $a = 1 | |
17 | &time ; | |
18 | ||
19 | ||
20 | Reversed %c= operator | |
21 | my $a =+ 2 ; | |
22 | $a =- 2 ; | |
23 | $a =* 2 ; | |
24 | $a =% 2 ; | |
25 | $a =& 2 ; | |
26 | $a =. 2 ; | |
27 | $a =^ 2 ; | |
28 | $a =| 2 ; | |
29 | $a =< 2 ; | |
30 | $a =/ 2 ; | |
31 | ||
32 | Multidimensional syntax %.*s not supported | |
33 | my $a = $a[1,2] ; | |
34 | ||
35 | You need to quote \"%s\"" | |
36 | sub fred {} ; $SIG{TERM} = fred; | |
37 | ||
38 | Scalar value %.*s better written as $%.*s" | |
39 | @a[3] = 2; | |
40 | @a{3} = 2; | |
41 | ||
42 | Can't use \\%c to mean $%c in expression | |
43 | $_ = "ab" ; s/(ab)/\1/e; | |
44 | ||
45 | Unquoted string "abc" may clash with future reserved word at - line 3. | |
46 | warn(warn_reserved | |
47 | $a = abc; | |
48 | ||
599cee73 PM |
49 | Possible attempt to separate words with commas |
50 | @a = qw(a, b, c) ; | |
51 | ||
52 | Possible attempt to put comments in qw() list | |
53 | @a = qw(a b # c) ; | |
54 | ||
599cee73 PM |
55 | %s (...) interpreted as function |
56 | print ("") | |
57 | printf ("") | |
58 | sort ("") | |
59 | ||
60 | Ambiguous use of %c{%s%s} resolved to %c%s%s | |
61 | $a = ${time[2]} | |
62 | $a = ${time{2}} | |
63 | ||
64 | ||
65 | Ambiguous use of %c{%s} resolved to %c%s | |
66 | $a = ${time} | |
67 | sub fred {} $a = ${fred} | |
68 | ||
69 | Misplaced _ in number | |
70 | $a = 1_2; | |
71 | $a = 1_2345_6; | |
72 | ||
73 | Bareword \"%s\" refers to nonexistent package | |
74 | $a = FRED:: ; | |
75 | ||
76 | Ambiguous call resolved as CORE::%s(), qualify as such or use & | |
77 | sub time {} | |
78 | my $a = time() | |
79 | ||
767a6a26 PM |
80 | Unrecognized escape \\%c passed through |
81 | $a = "\m" ; | |
82 | ||
820438b1 | 83 | Useless use of \\E. |
52ed07f6 BF |
84 | $a = "abcd\E" ; |
85 | ||
767a6a26 PM |
86 | %s number > %s non-portable |
87 | my $a = 0b011111111111111111111111111111110 ; | |
88 | $a = 0b011111111111111111111111111111111 ; | |
89 | $a = 0b111111111111111111111111111111111 ; | |
90 | $a = 0x0fffffffe ; | |
91 | $a = 0x0ffffffff ; | |
92 | $a = 0x1ffffffff ; | |
93 | $a = 0037777777776 ; | |
94 | $a = 0037777777777 ; | |
95 | $a = 0047777777777 ; | |
96 | ||
97 | Integer overflow in binary number | |
98 | my $a = 0b011111111111111111111111111111110 ; | |
99 | $a = 0b011111111111111111111111111111111 ; | |
100 | $a = 0b111111111111111111111111111111111 ; | |
101 | $a = 0x0fffffffe ; | |
102 | $a = 0x0ffffffff ; | |
103 | $a = 0x1ffffffff ; | |
104 | $a = 0037777777776 ; | |
105 | $a = 0037777777777 ; | |
106 | $a = 0047777777777 ; | |
ac206dc8 RGS |
107 | |
108 | dump() better written as CORE::dump() | |
4ac733c9 MJD |
109 | |
110 | Use of /c modifier is meaningless without /g | |
111 | ||
64e578a2 MJD |
112 | Use of /c modifier is meaningless in s/// |
113 | ||
0453d815 PM |
114 | Mandatory Warnings |
115 | ------------------ | |
116 | Use of "%s" without parentheses is ambiguous [check_uni] | |
117 | rand + 4 | |
118 | ||
119 | Ambiguous use of -%s resolved as -&%s() [yylex] | |
120 | sub fred {} ; - fred ; | |
121 | ||
122 | Precedence problem: open %.*s should be open(%.*s) [yylex] | |
123 | open FOO || die; | |
124 | ||
125 | Operator or semicolon missing before %c%s [yylex] | |
126 | Ambiguous use of %c resolved as operator %c | |
127 | *foo *foo | |
128 | ||
599cee73 PM |
129 | __END__ |
130 | # toke.c | |
599cee73 PM |
131 | format STDOUT = |
132 | @<<< @||| @>>> @>>> | |
133 | $a $b "abc" 'def' | |
134 | . | |
4438c4b7 | 135 | no warnings 'deprecated' ; |
0453d815 PM |
136 | format STDOUT = |
137 | @<<< @||| @>>> @>>> | |
138 | $a $b "abc" 'def' | |
139 | . | |
599cee73 | 140 | EXPECT |
d1d15184 NC |
141 | Use of comma-less variable list is deprecated at - line 4. |
142 | Use of comma-less variable list is deprecated at - line 4. | |
143 | Use of comma-less variable list is deprecated at - line 4. | |
599cee73 PM |
144 | ######## |
145 | # toke.c | |
e6897b1a | 146 | $a =~ m/$foo/sand $bar; |
aa78b661 | 147 | $a =~ s/$foo/fool/sand $bar; |
599cee73 PM |
148 | $a = <<; |
149 | ||
4438c4b7 | 150 | no warnings 'deprecated' ; |
e6897b1a | 151 | $a =~ m/$foo/sand $bar; |
aa78b661 | 152 | $a =~ s/$foo/fool/sand $bar; |
0453d815 PM |
153 | $a = <<; |
154 | ||
599cee73 | 155 | EXPECT |
e6897b1a | 156 | Having no space between pattern and following word is deprecated at - line 2. |
aa78b661 KW |
157 | Having no space between pattern and following word is deprecated at - line 3. |
158 | Use of bare << to mean <<"" is deprecated at - line 4. | |
599cee73 PM |
159 | ######## |
160 | # toke.c | |
4438c4b7 | 161 | use warnings 'syntax' ; |
599cee73 | 162 | s/(abc)/\1/; |
4438c4b7 | 163 | no warnings 'syntax' ; |
0453d815 | 164 | s/(abc)/\1/; |
599cee73 PM |
165 | EXPECT |
166 | \1 better written as $1 at - line 3. | |
167 | ######## | |
168 | # toke.c | |
4438c4b7 | 169 | use warnings 'semicolon' ; |
599cee73 PM |
170 | $a = 1 |
171 | &time ; | |
4438c4b7 | 172 | no warnings 'semicolon' ; |
0453d815 PM |
173 | $a = 1 |
174 | &time ; | |
599cee73 PM |
175 | EXPECT |
176 | Semicolon seems to be missing at - line 3. | |
177 | ######## | |
178 | # toke.c | |
4438c4b7 | 179 | use warnings 'syntax' ; |
599cee73 PM |
180 | my $a =+ 2 ; |
181 | $a =- 2 ; | |
182 | $a =* 2 ; | |
183 | $a =% 2 ; | |
184 | $a =& 2 ; | |
185 | $a =. 2 ; | |
186 | $a =^ 2 ; | |
187 | $a =| 2 ; | |
188 | $a =< 2 ; | |
189 | $a =/ 2 ; | |
190 | EXPECT | |
7f01dc7a JH |
191 | Reversed += operator at - line 3. |
192 | Reversed -= operator at - line 4. | |
193 | Reversed *= operator at - line 5. | |
194 | Reversed %= operator at - line 6. | |
195 | Reversed &= operator at - line 7. | |
196 | Reversed .= operator at - line 8. | |
197 | Reversed ^= operator at - line 9. | |
198 | Reversed |= operator at - line 10. | |
199 | Reversed <= operator at - line 11. | |
200 | syntax error at - line 8, near "=." | |
201 | syntax error at - line 9, near "=^" | |
202 | syntax error at - line 10, near "=|" | |
203 | Unterminated <> operator at - line 11. | |
599cee73 PM |
204 | ######## |
205 | # toke.c | |
4438c4b7 | 206 | no warnings 'syntax' ; |
0453d815 PM |
207 | my $a =+ 2 ; |
208 | $a =- 2 ; | |
209 | $a =* 2 ; | |
210 | $a =% 2 ; | |
211 | $a =& 2 ; | |
212 | $a =. 2 ; | |
213 | $a =^ 2 ; | |
214 | $a =| 2 ; | |
215 | $a =< 2 ; | |
216 | $a =/ 2 ; | |
217 | EXPECT | |
7f01dc7a JH |
218 | syntax error at - line 8, near "=." |
219 | syntax error at - line 9, near "=^" | |
220 | syntax error at - line 10, near "=|" | |
221 | Unterminated <> operator at - line 11. | |
0453d815 PM |
222 | ######## |
223 | # toke.c | |
4438c4b7 | 224 | use warnings 'syntax' ; |
599cee73 | 225 | my $a = $a[1,2] ; |
4438c4b7 | 226 | no warnings 'syntax' ; |
0453d815 | 227 | my $a = $a[1,2] ; |
599cee73 PM |
228 | EXPECT |
229 | Multidimensional syntax $a[1,2] not supported at - line 3. | |
230 | ######## | |
231 | # toke.c | |
4438c4b7 | 232 | use warnings 'syntax' ; |
599cee73 | 233 | sub fred {} ; $SIG{TERM} = fred; |
4438c4b7 | 234 | no warnings 'syntax' ; |
0453d815 | 235 | $SIG{TERM} = fred; |
599cee73 PM |
236 | EXPECT |
237 | You need to quote "fred" at - line 3. | |
238 | ######## | |
239 | # toke.c | |
4c01a014 BF |
240 | use utf8; |
241 | use open qw( :utf8 :std ); | |
242 | use warnings 'syntax' ; | |
243 | sub frèd {} ; $SIG{TERM} = frèd; | |
244 | no warnings 'syntax' ; | |
245 | $SIG{TERM} = frèd; | |
246 | EXPECT | |
247 | You need to quote "frèd" at - line 5. | |
248 | ######## | |
249 | # toke.c | |
250 | use utf8; | |
251 | use open qw( :utf8 :std ); | |
252 | use warnings 'syntax' ; | |
253 | sub ふれど {} ; $SIG{TERM} = ふれど; | |
254 | no warnings 'syntax' ; | |
255 | $SIG{TERM} = ふれど; | |
256 | EXPECT | |
257 | You need to quote "ふれど" at - line 5. | |
258 | ######## | |
259 | # toke.c | |
4438c4b7 | 260 | use warnings 'syntax' ; |
599cee73 PM |
261 | @a[3] = 2; |
262 | @a{3} = 2; | |
4438c4b7 | 263 | no warnings 'syntax' ; |
0453d815 PM |
264 | @a[3] = 2; |
265 | @a{3} = 2; | |
599cee73 PM |
266 | EXPECT |
267 | Scalar value @a[3] better written as $a[3] at - line 3. | |
268 | Scalar value @a{3} better written as $a{3} at - line 4. | |
269 | ######## | |
270 | # toke.c | |
b9e186cd BF |
271 | use utf8; |
272 | use open qw( :utf8 :std ); | |
273 | use warnings 'syntax' ; | |
274 | @à[3] = 2; | |
275 | @à{3} = 2; | |
276 | no warnings 'syntax' ; | |
277 | @à[3] = 2; | |
278 | @à{3} = 2; | |
279 | EXPECT | |
280 | Scalar value @à[3] better written as $à[3] at - line 5. | |
281 | Scalar value @à{3} better written as $à{3} at - line 6. | |
282 | ######## | |
283 | # toke.c | |
284 | use utf8; | |
285 | use open qw( :utf8 :std ); | |
286 | use warnings 'syntax' ; | |
287 | @ぁ[3] = 2; | |
288 | @ぁ{3} = 2; | |
289 | no warnings 'syntax' ; | |
290 | @ぁ[3] = 2; | |
291 | @ぁ{3} = 2; | |
292 | EXPECT | |
293 | Scalar value @ぁ[3] better written as $ぁ[3] at - line 5. | |
294 | Scalar value @ぁ{3} better written as $ぁ{3} at - line 6. | |
295 | ######## | |
296 | # toke.c | |
4438c4b7 | 297 | use warnings 'syntax' ; |
599cee73 PM |
298 | $_ = "ab" ; |
299 | s/(ab)/\1/e; | |
4438c4b7 | 300 | no warnings 'syntax' ; |
0453d815 PM |
301 | $_ = "ab" ; |
302 | s/(ab)/\1/e; | |
599cee73 PM |
303 | EXPECT |
304 | Can't use \1 to mean $1 in expression at - line 4. | |
305 | ######## | |
306 | # toke.c | |
4438c4b7 | 307 | use warnings 'reserved' ; |
599cee73 | 308 | $a = abc; |
1c3923b3 GS |
309 | $a = { def |
310 | ||
311 | => 1 }; | |
4438c4b7 | 312 | no warnings 'reserved' ; |
0453d815 | 313 | $a = abc; |
599cee73 PM |
314 | EXPECT |
315 | Unquoted string "abc" may clash with future reserved word at - line 3. | |
316 | ######## | |
317 | # toke.c | |
e476b1b5 | 318 | use warnings 'qw' ; |
599cee73 | 319 | @a = qw(a, b, c) ; |
e476b1b5 | 320 | no warnings 'qw' ; |
0453d815 | 321 | @a = qw(a, b, c) ; |
599cee73 PM |
322 | EXPECT |
323 | Possible attempt to separate words with commas at - line 3. | |
324 | ######## | |
325 | # toke.c | |
e476b1b5 | 326 | use warnings 'qw' ; |
7e03b518 | 327 | @a = qw(a b c # #) ; |
e476b1b5 | 328 | no warnings 'qw' ; |
7e03b518 | 329 | @a = qw(a b c # #) ; |
599cee73 PM |
330 | EXPECT |
331 | Possible attempt to put comments in qw() list at - line 3. | |
332 | ######## | |
333 | # toke.c | |
7e03b518 EB |
334 | use warnings 'qw' ; |
335 | @a = qw(a, b, c # #) ; | |
336 | no warnings 'qw' ; | |
337 | @a = qw(a, b, c # #) ; | |
338 | EXPECT | |
339 | Possible attempt to separate words with commas at - line 3. | |
340 | Possible attempt to put comments in qw() list at - line 3. | |
341 | ######## | |
342 | # toke.c | |
4438c4b7 | 343 | use warnings 'syntax' ; |
b1439985 RGS |
344 | print (""); |
345 | print ("") and $x = 1; | |
346 | print ("") or die; | |
347 | print ("") // die; | |
348 | print (1+2) * 3 if 0; # only this one should warn | |
349 | print (1+2) if 0; | |
599cee73 | 350 | EXPECT |
b1439985 | 351 | print (...) interpreted as function at - line 7. |
599cee73 PM |
352 | ######## |
353 | # toke.c | |
4438c4b7 | 354 | no warnings 'syntax' ; |
0453d815 PM |
355 | print ("") |
356 | EXPECT | |
357 | ||
358 | ######## | |
359 | # toke.c | |
4438c4b7 | 360 | use warnings 'syntax' ; |
b1439985 RGS |
361 | printf (""); |
362 | printf ("") . ''; | |
599cee73 | 363 | EXPECT |
b1439985 | 364 | printf (...) interpreted as function at - line 4. |
599cee73 PM |
365 | ######## |
366 | # toke.c | |
4438c4b7 | 367 | no warnings 'syntax' ; |
0453d815 PM |
368 | printf ("") |
369 | EXPECT | |
370 | ||
371 | ######## | |
372 | # toke.c | |
4438c4b7 | 373 | use warnings 'syntax' ; |
b1439985 RGS |
374 | sort (""); |
375 | sort ("") . ''; | |
599cee73 | 376 | EXPECT |
b1439985 | 377 | sort (...) interpreted as function at - line 4. |
599cee73 PM |
378 | ######## |
379 | # toke.c | |
4438c4b7 | 380 | no warnings 'syntax' ; |
0453d815 PM |
381 | sort ("") |
382 | EXPECT | |
383 | ||
384 | ######## | |
385 | # toke.c | |
4438c4b7 | 386 | use warnings 'ambiguous' ; |
599cee73 | 387 | $a = ${time[2]}; |
4438c4b7 | 388 | no warnings 'ambiguous' ; |
0453d815 | 389 | $a = ${time[2]}; |
599cee73 PM |
390 | EXPECT |
391 | Ambiguous use of ${time[...]} resolved to $time[...] at - line 3. | |
392 | ######## | |
393 | # toke.c | |
4438c4b7 | 394 | use warnings 'ambiguous' ; |
599cee73 PM |
395 | $a = ${time{2}}; |
396 | EXPECT | |
397 | Ambiguous use of ${time{...}} resolved to $time{...} at - line 3. | |
398 | ######## | |
399 | # toke.c | |
4438c4b7 | 400 | no warnings 'ambiguous' ; |
0453d815 PM |
401 | $a = ${time{2}}; |
402 | EXPECT | |
403 | ||
404 | ######## | |
405 | # toke.c | |
4438c4b7 | 406 | use warnings 'ambiguous' ; |
599cee73 | 407 | $a = ${time} ; |
4438c4b7 | 408 | no warnings 'ambiguous' ; |
0453d815 | 409 | $a = ${time} ; |
599cee73 PM |
410 | EXPECT |
411 | Ambiguous use of ${time} resolved to $time at - line 3. | |
412 | ######## | |
413 | # toke.c | |
4438c4b7 | 414 | use warnings 'ambiguous' ; |
599cee73 PM |
415 | sub fred {} |
416 | $a = ${fred} ; | |
4438c4b7 | 417 | no warnings 'ambiguous' ; |
0453d815 | 418 | $a = ${fred} ; |
599cee73 PM |
419 | EXPECT |
420 | Ambiguous use of ${fred} resolved to $fred at - line 4. | |
421 | ######## | |
422 | # toke.c | |
4438c4b7 | 423 | use warnings 'syntax' ; |
7fd134d9 JH |
424 | $a = _123; print "$a\n"; #( 3 string) |
425 | $a = 1_23; print "$a\n"; | |
426 | $a = 12_3; print "$a\n"; | |
427 | $a = 123_; print "$a\n"; # 6 | |
428 | $a = _+123; print "$a\n"; # 7 string) | |
429 | $a = +_123; print "$a\n"; #( 8 string) | |
430 | $a = +1_23; print "$a\n"; | |
431 | $a = +12_3; print "$a\n"; | |
432 | $a = +123_; print "$a\n"; # 11 | |
433 | $a = _-123; print "$a\n"; #(12 string) | |
434 | $a = -_123; print "$a\n"; #(13 string) | |
435 | $a = -1_23; print "$a\n"; | |
436 | $a = -12_3; print "$a\n"; | |
437 | $a = -123_; print "$a\n"; # 16 | |
438 | $a = 123._456; print "$a\n"; # 17 | |
439 | $a = 123.4_56; print "$a\n"; | |
440 | $a = 123.45_6; print "$a\n"; | |
441 | $a = 123.456_; print "$a\n"; # 20 | |
442 | $a = +123._456; print "$a\n"; # 21 | |
443 | $a = +123.4_56; print "$a\n"; | |
444 | $a = +123.45_6; print "$a\n"; | |
445 | $a = +123.456_; print "$a\n"; # 24 | |
446 | $a = -123._456; print "$a\n"; # 25 | |
447 | $a = -123.4_56; print "$a\n"; | |
448 | $a = -123.45_6; print "$a\n"; | |
449 | $a = -123.456_; print "$a\n"; # 28 | |
2bea9a37 JH |
450 | $a = 123.456E_12; printf("%.0f\n", $a); # 29 |
451 | $a = 123.456E1_2; printf("%.0f\n", $a); | |
452 | $a = 123.456E12_; printf("%.0f\n", $a); # 31 | |
453 | $a = 123.456E_+12; printf("%.0f\n", $a); # 32 | |
454 | $a = 123.456E+_12; printf("%.0f\n", $a); # 33 | |
455 | $a = 123.456E+1_2; printf("%.0f\n", $a); | |
456 | $a = 123.456E+12_; printf("%.0f\n", $a); # 35 | |
7fd134d9 JH |
457 | $a = 123.456E_-12; print "$a\n"; # 36 |
458 | $a = 123.456E-_12; print "$a\n"; # 37 | |
459 | $a = 123.456E-1_2; print "$a\n"; | |
460 | $a = 123.456E-12_; print "$a\n"; # 39 | |
b3b48e3e JH |
461 | $a = 1__23; print "$a\n"; # 40 |
462 | $a = 12.3__4; print "$a\n"; # 41 | |
2bea9a37 | 463 | $a = 12.34e1__2; printf("%.0f\n", $a); # 42 |
4438c4b7 | 464 | no warnings 'syntax' ; |
7fd134d9 JH |
465 | $a = _123; print "$a\n"; |
466 | $a = 1_23; print "$a\n"; | |
467 | $a = 12_3; print "$a\n"; | |
468 | $a = 123_; print "$a\n"; | |
469 | $a = _+123; print "$a\n"; | |
470 | $a = +_123; print "$a\n"; | |
471 | $a = +1_23; print "$a\n"; | |
472 | $a = +12_3; print "$a\n"; | |
473 | $a = +123_; print "$a\n"; | |
474 | $a = _-123; print "$a\n"; | |
475 | $a = -_123; print "$a\n"; | |
476 | $a = -1_23; print "$a\n"; | |
477 | $a = -12_3; print "$a\n"; | |
478 | $a = -123_; print "$a\n"; | |
479 | $a = 123._456; print "$a\n"; | |
480 | $a = 123.4_56; print "$a\n"; | |
481 | $a = 123.45_6; print "$a\n"; | |
482 | $a = 123.456_; print "$a\n"; | |
483 | $a = +123._456; print "$a\n"; | |
484 | $a = +123.4_56; print "$a\n"; | |
485 | $a = +123.45_6; print "$a\n"; | |
486 | $a = +123.456_; print "$a\n"; | |
487 | $a = -123._456; print "$a\n"; | |
488 | $a = -123.4_56; print "$a\n"; | |
489 | $a = -123.45_6; print "$a\n"; | |
490 | $a = -123.456_; print "$a\n"; | |
2bea9a37 JH |
491 | $a = 123.456E_12; printf("%.0f\n", $a); |
492 | $a = 123.456E1_2; printf("%.0f\n", $a); | |
493 | $a = 123.456E12_; printf("%.0f\n", $a); | |
494 | $a = 123.456E_+12; printf("%.0f\n", $a); | |
495 | $a = 123.456E+_12; printf("%.0f\n", $a); | |
496 | $a = 123.456E+1_2; printf("%.0f\n", $a); | |
497 | $a = 123.456E+12_; printf("%.0f\n", $a); | |
7fd134d9 JH |
498 | $a = 123.456E_-12; print "$a\n"; |
499 | $a = 123.456E-_12; print "$a\n"; | |
500 | $a = 123.456E-1_2; print "$a\n"; | |
501 | $a = 123.456E-12_; print "$a\n"; | |
b3b48e3e JH |
502 | $a = 1__23; print "$a\n"; |
503 | $a = 12.3__4; print "$a\n"; | |
2bea9a37 | 504 | $a = 12.34e1__2; printf("%.0f\n", $a); |
599cee73 | 505 | EXPECT |
fbfa96bd | 506 | OPTIONS regex |
928753ea | 507 | Misplaced _ in number at - line 6. |
928753ea | 508 | Misplaced _ in number at - line 11. |
7fd134d9 | 509 | Misplaced _ in number at - line 16. |
928753ea | 510 | Misplaced _ in number at - line 17. |
7fd134d9 | 511 | Misplaced _ in number at - line 20. |
928753ea | 512 | Misplaced _ in number at - line 21. |
7fd134d9 JH |
513 | Misplaced _ in number at - line 24. |
514 | Misplaced _ in number at - line 25. | |
515 | Misplaced _ in number at - line 28. | |
516 | Misplaced _ in number at - line 29. | |
517 | Misplaced _ in number at - line 31. | |
518 | Misplaced _ in number at - line 32. | |
519 | Misplaced _ in number at - line 33. | |
520 | Misplaced _ in number at - line 35. | |
521 | Misplaced _ in number at - line 36. | |
522 | Misplaced _ in number at - line 37. | |
523 | Misplaced _ in number at - line 39. | |
b3b48e3e JH |
524 | Misplaced _ in number at - line 40. |
525 | Misplaced _ in number at - line 41. | |
526 | Misplaced _ in number at - line 42. | |
928753ea JH |
527 | _123 |
528 | 123 | |
928753ea | 529 | 123 |
7fd134d9 JH |
530 | 123 |
531 | 123 | |
532 | _123 | |
533 | 123 | |
534 | 123 | |
535 | 123 | |
536 | -123 | |
537 | -_123 | |
538 | -123 | |
539 | -123 | |
540 | -123 | |
541 | 123.456 | |
542 | 123.456 | |
543 | 123.456 | |
544 | 123.456 | |
545 | 123.456 | |
546 | 123.456 | |
547 | 123.456 | |
548 | 123.456 | |
549 | -123.456 | |
550 | -123.456 | |
551 | -123.456 | |
552 | -123.456 | |
553 | 123456000000000 | |
554 | 123456000000000 | |
555 | 123456000000000 | |
556 | 123456000000000 | |
557 | 123456000000000 | |
558 | 123456000000000 | |
559 | 123456000000000 | |
fbfa96bd NIS |
560 | 1.23456e-0?10 |
561 | 1.23456e-0?10 | |
562 | 1.23456e-0?10 | |
563 | 1.23456e-0?10 | |
b3b48e3e JH |
564 | 123 |
565 | 12.34 | |
566 | 12340000000000 | |
7fd134d9 JH |
567 | _123 |
568 | 123 | |
569 | 123 | |
570 | 123 | |
571 | 123 | |
572 | _123 | |
573 | 123 | |
574 | 123 | |
575 | 123 | |
576 | -123 | |
577 | -_123 | |
578 | -123 | |
579 | -123 | |
580 | -123 | |
581 | 123.456 | |
582 | 123.456 | |
583 | 123.456 | |
584 | 123.456 | |
585 | 123.456 | |
928753ea JH |
586 | 123.456 |
587 | 123.456 | |
928753ea | 588 | 123.456 |
7fd134d9 JH |
589 | -123.456 |
590 | -123.456 | |
591 | -123.456 | |
592 | -123.456 | |
593 | 123456000000000 | |
594 | 123456000000000 | |
595 | 123456000000000 | |
596 | 123456000000000 | |
597 | 123456000000000 | |
598 | 123456000000000 | |
599 | 123456000000000 | |
fbfa96bd NIS |
600 | 1.23456e-0?10 |
601 | 1.23456e-0?10 | |
602 | 1.23456e-0?10 | |
603 | 1.23456e-0?10 | |
b3b48e3e JH |
604 | 123 |
605 | 12.34 | |
606 | 12340000000000 | |
599cee73 PM |
607 | ######## |
608 | # toke.c | |
e476b1b5 | 609 | use warnings 'bareword' ; |
60e6418e | 610 | #line 25 "bar" |
599cee73 | 611 | $a = FRED:: ; |
e476b1b5 | 612 | no warnings 'bareword' ; |
0453d815 PM |
613 | #line 25 "bar" |
614 | $a = FRED:: ; | |
599cee73 | 615 | EXPECT |
60e6418e | 616 | Bareword "FRED::" refers to nonexistent package at bar line 25. |
979a1401 BF |
617 | ######## |
618 | # toke.c | |
619 | use utf8; | |
620 | use open qw( :utf8 :std ); | |
621 | use warnings 'bareword' ; | |
622 | #line 25 "bar" | |
623 | $a = FRÈD:: ; | |
624 | no warnings 'bareword' ; | |
625 | #line 25 "bar" | |
626 | $a = FRÈD:: ; | |
627 | EXPECT | |
628 | Bareword "FRÈD::" refers to nonexistent package at bar line 25. | |
629 | ######## | |
630 | # toke.c | |
631 | use utf8; | |
632 | use open qw( :utf8 :std ); | |
633 | use warnings 'bareword' ; | |
634 | #line 25 "bar" | |
635 | $a = ϞϞϞ:: ; | |
636 | no warnings 'bareword' ; | |
637 | #line 25 "bar" | |
638 | $a = ϞϞϞ:: ; | |
639 | EXPECT | |
640 | Bareword "ϞϞϞ::" refers to nonexistent package at bar line 25. | |
599cee73 PM |
641 | ######## |
642 | # toke.c | |
4438c4b7 | 643 | use warnings 'ambiguous' ; |
599cee73 | 644 | sub time {} |
0453d815 | 645 | my $a = time() ; |
4438c4b7 | 646 | no warnings 'ambiguous' ; |
0453d815 | 647 | my $b = time() ; |
599cee73 PM |
648 | EXPECT |
649 | Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4. | |
650 | ######## | |
651 | # toke.c | |
26d16222 | 652 | use warnings ; |
0453d815 | 653 | eval <<'EOE'; |
df0deb90 GS |
654 | # line 30 "foo" |
655 | warn "yelp"; | |
0453d815 | 656 | { |
0453d815 PM |
657 | $_ = " \x{123} " ; |
658 | } | |
659 | EOE | |
660 | EXPECT | |
df0deb90 | 661 | yelp at foo line 30. |
0453d815 PM |
662 | ######## |
663 | # toke.c | |
0453d815 PM |
664 | my $a = rand + 4 ; |
665 | EXPECT | |
2d5ccbba | 666 | Warning: Use of "rand" without parentheses is ambiguous at - line 2. |
0453d815 PM |
667 | ######## |
668 | # toke.c | |
669 | $^W = 0 ; | |
670 | my $a = rand + 4 ; | |
671 | { | |
4438c4b7 | 672 | no warnings 'ambiguous' ; |
0453d815 | 673 | $a = rand + 4 ; |
4438c4b7 | 674 | use warnings 'ambiguous' ; |
0453d815 PM |
675 | $a = rand + 4 ; |
676 | } | |
677 | $a = rand + 4 ; | |
678 | EXPECT | |
2d5ccbba IT |
679 | Warning: Use of "rand" without parentheses is ambiguous at - line 3. |
680 | Warning: Use of "rand" without parentheses is ambiguous at - line 8. | |
681 | Warning: Use of "rand" without parentheses is ambiguous at - line 10. | |
0453d815 | 682 | ######## |
e19a021b FC |
683 | # [perl #97110] |
684 | sub myrand(;$) { } | |
b5fb7ce3 | 685 | sub whatever($) { } |
e19a021b | 686 | my $a = myrand + 4 ; |
b5fb7ce3 | 687 | my $b = whatever + 4 ; |
e19a021b | 688 | EXPECT |
b5fb7ce3 | 689 | Warning: Use of "myrand" without parentheses is ambiguous at - line 4. |
e19a021b | 690 | ######## |
0453d815 | 691 | # toke.c |
e8ae98db RGS |
692 | use warnings "ambiguous"; |
693 | print for keys %+; # should not warn | |
694 | EXPECT | |
695 | ######## | |
696 | # toke.c | |
0453d815 PM |
697 | sub fred {}; |
698 | -fred ; | |
699 | EXPECT | |
700 | Ambiguous use of -fred resolved as -&fred() at - line 3. | |
701 | ######## | |
702 | # toke.c | |
703 | $^W = 0 ; | |
704 | sub fred {} ; | |
705 | -fred ; | |
706 | { | |
4438c4b7 | 707 | no warnings 'ambiguous' ; |
0453d815 | 708 | -fred ; |
4438c4b7 | 709 | use warnings 'ambiguous' ; |
0453d815 PM |
710 | -fred ; |
711 | } | |
712 | -fred ; | |
713 | EXPECT | |
714 | Ambiguous use of -fred resolved as -&fred() at - line 4. | |
715 | Ambiguous use of -fred resolved as -&fred() at - line 9. | |
716 | Ambiguous use of -fred resolved as -&fred() at - line 11. | |
717 | ######## | |
718 | # toke.c | |
43b5ab4c BF |
719 | use utf8; |
720 | use open qw( :utf8 :std ); | |
721 | sub frèd {}; | |
722 | -frèd ; | |
723 | EXPECT | |
724 | Ambiguous use of -frèd resolved as -&frèd() at - line 5. | |
725 | ######## | |
726 | # toke.c | |
727 | $^W = 0 ; | |
728 | use utf8; | |
729 | use open qw( :utf8 :std ); | |
730 | sub frèd {} ; | |
731 | -frèd ; | |
732 | { | |
733 | no warnings 'ambiguous' ; | |
734 | -frèd ; | |
735 | use warnings 'ambiguous' ; | |
736 | -frèd ; | |
737 | } | |
738 | -frèd ; | |
739 | EXPECT | |
740 | Ambiguous use of -frèd resolved as -&frèd() at - line 6. | |
741 | Ambiguous use of -frèd resolved as -&frèd() at - line 11. | |
742 | Ambiguous use of -frèd resolved as -&frèd() at - line 13. | |
743 | ######## | |
744 | # toke.c | |
745 | use utf8; | |
746 | use open qw( :utf8 :std ); | |
747 | sub ᒍᒘᒊ {}; | |
748 | -ᒍᒘᒊ ; | |
749 | EXPECT | |
750 | Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 5. | |
751 | ######## | |
752 | # toke.c | |
753 | $^W = 0 ; | |
754 | use utf8; | |
755 | use open qw( :utf8 :std ); | |
756 | sub ᒍᒘᒊ {} ; | |
757 | -ᒍᒘᒊ ; | |
758 | { | |
759 | no warnings 'ambiguous' ; | |
760 | -ᒍᒘᒊ ; | |
761 | use warnings 'ambiguous' ; | |
762 | -ᒍᒘᒊ ; | |
763 | } | |
764 | -ᒍᒘᒊ ; | |
765 | EXPECT | |
766 | Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 6. | |
767 | Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 11. | |
768 | Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 13. | |
769 | ######## | |
770 | # toke.c | |
0453d815 | 771 | open FOO || time; |
240d1b6f | 772 | open local *FOO; # should be ok |
0453d815 PM |
773 | EXPECT |
774 | Precedence problem: open FOO should be open(FOO) at - line 2. | |
775 | ######## | |
66fbe8fb HS |
776 | # toke.c (and [perl #16184]) |
777 | open FOO => "<&0"; close FOO; | |
778 | EXPECT | |
779 | ######## | |
0453d815 PM |
780 | # toke.c |
781 | $^W = 0 ; | |
782 | open FOO || time; | |
783 | { | |
e476b1b5 | 784 | no warnings 'precedence' ; |
0453d815 | 785 | open FOO || time; |
e476b1b5 | 786 | use warnings 'precedence' ; |
0453d815 PM |
787 | open FOO || time; |
788 | } | |
789 | open FOO || time; | |
db3abe52 | 790 | open Foo::BAR; # this should not warn |
0453d815 PM |
791 | EXPECT |
792 | Precedence problem: open FOO should be open(FOO) at - line 3. | |
793 | Precedence problem: open FOO should be open(FOO) at - line 8. | |
794 | Precedence problem: open FOO should be open(FOO) at - line 10. | |
795 | ######## | |
796 | # toke.c | |
797 | $^W = 0 ; | |
798 | *foo *foo ; | |
799 | { | |
4438c4b7 | 800 | no warnings 'ambiguous' ; |
0453d815 | 801 | *foo *foo ; |
4438c4b7 | 802 | use warnings 'ambiguous' ; |
0453d815 PM |
803 | *foo *foo ; |
804 | } | |
805 | *foo *foo ; | |
806 | EXPECT | |
807 | Operator or semicolon missing before *foo at - line 3. | |
808 | Ambiguous use of * resolved as operator * at - line 3. | |
809 | Operator or semicolon missing before *foo at - line 8. | |
810 | Ambiguous use of * resolved as operator * at - line 8. | |
811 | Operator or semicolon missing before *foo at - line 10. | |
812 | Ambiguous use of * resolved as operator * at - line 10. | |
767a6a26 PM |
813 | ######## |
814 | # toke.c | |
02571fe8 BF |
815 | use utf8; |
816 | use open qw( :utf8 :std ); | |
817 | $^W = 0 ; | |
818 | *foo *foo ; | |
819 | { | |
820 | no warnings 'ambiguous' ; | |
821 | *foo *foo ; | |
822 | use warnings 'ambiguous' ; | |
823 | *foo *foo ; | |
824 | } | |
825 | *foo *foo ; | |
826 | EXPECT | |
827 | Operator or semicolon missing before *foo at - line 5. | |
828 | Ambiguous use of * resolved as operator * at - line 5. | |
829 | Operator or semicolon missing before *foo at - line 10. | |
830 | Ambiguous use of * resolved as operator * at - line 10. | |
831 | Operator or semicolon missing before *foo at - line 12. | |
832 | Ambiguous use of * resolved as operator * at - line 12. | |
833 | ######## | |
834 | # toke.c | |
e476b1b5 | 835 | use warnings 'misc' ; |
767a6a26 | 836 | my $a = "\m" ; |
e476b1b5 | 837 | no warnings 'misc' ; |
767a6a26 PM |
838 | $a = "\m" ; |
839 | EXPECT | |
840 | Unrecognized escape \m passed through at - line 3. | |
841 | ######## | |
842 | # toke.c | |
52ed07f6 BF |
843 | use warnings 'misc' ; |
844 | my $a = "abcd\E" ; | |
845 | no warnings 'misc' ; | |
846 | $a = "abcd\E" ; | |
847 | EXPECT | |
820438b1 | 848 | Useless use of \E at - line 3. |
52ed07f6 BF |
849 | ######## |
850 | # toke.c | |
767a6a26 PM |
851 | use warnings 'portable' ; |
852 | my $a = 0b011111111111111111111111111111110 ; | |
853 | $a = 0b011111111111111111111111111111111 ; | |
854 | $a = 0b111111111111111111111111111111111 ; | |
855 | $a = 0x0fffffffe ; | |
856 | $a = 0x0ffffffff ; | |
857 | $a = 0x1ffffffff ; | |
858 | $a = 0037777777776 ; | |
859 | $a = 0037777777777 ; | |
860 | $a = 0047777777777 ; | |
861 | no warnings 'portable' ; | |
862 | $a = 0b011111111111111111111111111111110 ; | |
863 | $a = 0b011111111111111111111111111111111 ; | |
864 | $a = 0b111111111111111111111111111111111 ; | |
865 | $a = 0x0fffffffe ; | |
866 | $a = 0x0ffffffff ; | |
867 | $a = 0x1ffffffff ; | |
868 | $a = 0037777777776 ; | |
869 | $a = 0037777777777 ; | |
870 | $a = 0047777777777 ; | |
871 | EXPECT | |
872 | Binary number > 0b11111111111111111111111111111111 non-portable at - line 5. | |
873 | Hexadecimal number > 0xffffffff non-portable at - line 8. | |
874 | Octal number > 037777777777 non-portable at - line 11. | |
875 | ######## | |
876 | # toke.c | |
877 | use warnings 'overflow' ; | |
878 | my $a = 0b011111111111111111111111111111110 ; | |
879 | $a = 0b011111111111111111111111111111111 ; | |
15041a67 | 880 | $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ; |
767a6a26 PM |
881 | $a = 0x0fffffffe ; |
882 | $a = 0x0ffffffff ; | |
15041a67 | 883 | $a = 0x10000000000000000 ; |
767a6a26 PM |
884 | $a = 0037777777776 ; |
885 | $a = 0037777777777 ; | |
15041a67 | 886 | $a = 002000000000000000000000; |
767a6a26 PM |
887 | no warnings 'overflow' ; |
888 | $a = 0b011111111111111111111111111111110 ; | |
889 | $a = 0b011111111111111111111111111111111 ; | |
15041a67 | 890 | $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ; |
767a6a26 PM |
891 | $a = 0x0fffffffe ; |
892 | $a = 0x0ffffffff ; | |
15041a67 | 893 | $a = 0x10000000000000000 ; |
767a6a26 PM |
894 | $a = 0037777777776 ; |
895 | $a = 0037777777777 ; | |
15041a67 | 896 | $a = 002000000000000000000000; |
767a6a26 PM |
897 | EXPECT |
898 | Integer overflow in binary number at - line 5. | |
899 | Integer overflow in hexadecimal number at - line 8. | |
900 | Integer overflow in octal number at - line 11. | |
8593bda5 GS |
901 | ######## |
902 | # toke.c | |
ac206dc8 RGS |
903 | BEGIN { $^C = 1; } |
904 | use warnings 'misc'; | |
905 | dump; | |
906 | CORE::dump; | |
907 | EXPECT | |
908 | dump() better written as CORE::dump() at - line 4. | |
909 | - syntax OK | |
910 | ######## | |
911 | # toke.c | |
912 | use warnings 'misc'; | |
913 | use subs qw/dump/; | |
93f09d7b | 914 | sub dump { print "no warning for overridden dump\n"; } |
ac206dc8 RGS |
915 | dump; |
916 | EXPECT | |
93f09d7b | 917 | no warning for overridden dump |
ac206dc8 RGS |
918 | ######## |
919 | # toke.c | |
8593bda5 GS |
920 | use warnings 'ambiguous'; |
921 | "@mjd_previously_unused_array"; | |
922 | no warnings 'ambiguous'; | |
29fb1d0e | 923 | "@mjd_previously_unused_array2"; |
8593bda5 GS |
924 | EXPECT |
925 | Possible unintended interpolation of @mjd_previously_unused_array in string at - line 3. | |
707afd92 MS |
926 | ######## |
927 | # toke.c | |
29fb1d0e BF |
928 | use utf8; |
929 | use open qw( :utf8 :std ); | |
930 | use warnings 'ambiguous'; | |
931 | "@mjd_previously_unused_àrray"; | |
932 | no warnings 'ambiguous'; | |
933 | "@mjd_previously_unused_àrray2"; | |
934 | EXPECT | |
935 | Possible unintended interpolation of @mjd_previously_unused_àrray in string at - line 5. | |
936 | ######## | |
937 | # toke.c | |
938 | use utf8; | |
939 | use open qw( :utf8 :std ); | |
940 | use warnings 'ambiguous'; | |
941 | "@mjd_previously_unused_ぁrrぁy"; | |
942 | no warnings 'ambiguous'; | |
943 | "@mjd_previously_unused_ぁrrぁy2"; | |
944 | EXPECT | |
945 | Possible unintended interpolation of @mjd_previously_unused_ぁrrぁy in string at - line 5. | |
946 | ######## | |
947 | # toke.c | |
d8c55666 | 948 | # 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com |
4ac733c9 MJD |
949 | use warnings 'regexp'; |
950 | "foo" =~ /foo/c; | |
64e578a2 | 951 | "foo" =~ /foo/cg; |
4ac733c9 MJD |
952 | no warnings 'regexp'; |
953 | "foo" =~ /foo/c; | |
64e578a2 | 954 | "foo" =~ /foo/cg; |
4ac733c9 MJD |
955 | EXPECT |
956 | Use of /c modifier is meaningless without /g at - line 4. | |
957 | ######## | |
958 | # toke.c | |
d8c55666 | 959 | # 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com |
4ac733c9 MJD |
960 | use warnings 'regexp'; |
961 | $_ = "ab" ; | |
962 | s/ab/ab/c; | |
64e578a2 | 963 | s/ab/ab/cg; |
4ac733c9 MJD |
964 | no warnings 'regexp'; |
965 | s/ab/ab/c; | |
64e578a2 | 966 | s/ab/ab/cg; |
4ac733c9 | 967 | EXPECT |
64e578a2 MJD |
968 | Use of /c modifier is meaningless in s/// at - line 5. |
969 | Use of /c modifier is meaningless in s/// at - line 6. | |
d8c55666 MJD |
970 | ######## |
971 | -wa | |
972 | # toke.c | |
973 | # 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings | |
974 | print "@F\n"; | |
975 | EXPECT | |
976 | ||
977 | ######## | |
978 | -w | |
979 | # toke.c | |
980 | # 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings | |
981 | print "@F\n"; | |
982 | EXPECT | |
983 | Possible unintended interpolation of @F in string at - line 4. | |
984 | Name "main::F" used only once: possible typo at - line 4. | |
985 | ######## | |
986 | -wa | |
987 | # toke.c | |
988 | # 20020414 mjd-perl-patch+@plover.com | |
989 | EXPECT | |
990 | ||
2710853f MJD |
991 | ######## |
992 | # toke.c | |
993 | # 20020414 mjd-perl-patch+@plover.com | |
994 | # In 5.7.3, this emitted "Possible unintended interpolation" warnings | |
995 | use warnings 'ambiguous'; | |
996 | $s = "(@-)(@+)"; | |
997 | EXPECT | |
998 | ||
56da5a46 RGS |
999 | ######## |
1000 | # toke.c | |
1001 | # mandatory warning | |
1002 | eval q/if ($a) { } elseif ($b) { }/; | |
1003 | no warnings "syntax"; | |
1004 | eval q/if ($a) { } elseif ($b) { }/; | |
1005 | EXPECT | |
1006 | elseif should be elsif at (eval 1) line 1. | |
1007 | ######## | |
1008 | # toke.c | |
1009 | # mandatory warning | |
1010 | eval q/5 6/; | |
1011 | no warnings "syntax"; | |
1012 | eval q/5 6/; | |
1013 | EXPECT | |
1014 | Number found where operator expected at (eval 1) line 1, near "5 6" | |
1015 | (Missing operator before 6?) | |
984200d0 YST |
1016 | ######## |
1017 | # toke.c | |
1018 | use warnings "syntax"; | |
1019 | $_ = $a = 1; | |
1020 | $a !=~ /1/; | |
1021 | $a !=~ m#1#; | |
1022 | $a !=~/1/; | |
1023 | $a !=~ ?/?; | |
decca21c YST |
1024 | $a !=~ y/1//; |
1025 | $a !=~ tr/1//; | |
1026 | $a !=~ s/1//; | |
984200d0 YST |
1027 | $a != ~/1/; |
1028 | no warnings "syntax"; | |
1029 | $a !=~ /1/; | |
1030 | $a !=~ m#1#; | |
1031 | $a !=~/1/; | |
1032 | $a !=~ ?/?; | |
decca21c YST |
1033 | $a !=~ y/1//; |
1034 | $a !=~ tr/1//; | |
1035 | $a !=~ s/1//; | |
984200d0 YST |
1036 | EXPECT |
1037 | !=~ should be !~ at - line 4. | |
1038 | !=~ should be !~ at - line 5. | |
1039 | !=~ should be !~ at - line 6. | |
1040 | !=~ should be !~ at - line 7. | |
decca21c YST |
1041 | !=~ should be !~ at - line 8. |
1042 | !=~ should be !~ at - line 9. | |
1043 | !=~ should be !~ at - line 10. | |
1108974d RGS |
1044 | ######## |
1045 | # toke.c | |
1046 | our $foo :unique; | |
8e5dadda NC |
1047 | sub pam :locked; |
1048 | sub glipp :locked { | |
1049 | } | |
1050 | sub whack_eth ($) : locked { | |
1051 | } | |
d1d15184 | 1052 | no warnings 'deprecated'; |
1108974d | 1053 | our $bar :unique; |
8e5dadda NC |
1054 | sub zapeth :locked; |
1055 | sub ker_plop :locked { | |
1056 | } | |
1057 | sub swa_a_p ($) : locked { | |
1058 | } | |
1108974d | 1059 | EXPECT |
d1d15184 NC |
1060 | Use of :unique is deprecated at - line 2. |
1061 | Use of :locked is deprecated at - line 3. | |
1062 | Use of :locked is deprecated at - line 4. | |
1063 | Use of :locked is deprecated at - line 6. | |
9e8d7757 RB |
1064 | ######## |
1065 | # toke.c | |
1066 | use warnings "syntax"; | |
1067 | sub proto_after_array(@$); | |
1068 | sub proto_after_arref(\@$); | |
1069 | sub proto_after_arref2(\[@$]); | |
1070 | sub proto_after_arref3(\[@$]_); | |
1071 | sub proto_after_hash(%$); | |
1072 | sub proto_after_hashref(\%$); | |
1073 | sub proto_after_hashref2(\[%$]); | |
1074 | sub underscore_last_pos($_); | |
1075 | sub underscore2($_;$); | |
1076 | sub underscore_fail($_$); | |
1077 | sub underscore_after_at(@_); | |
1078 | no warnings "syntax"; | |
1079 | sub proto_after_array(@$); | |
1080 | sub proto_after_hash(%$); | |
1081 | sub underscore_fail($_$); | |
1082 | EXPECT | |
1083 | Prototype after '@' for main::proto_after_array : @$ at - line 3. | |
1084 | Prototype after '%' for main::proto_after_hash : %$ at - line 7. | |
aef2a98a | 1085 | Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12. |
9e8d7757 | 1086 | Prototype after '@' for main::underscore_after_at : @_ at - line 13. |
77772344 B |
1087 | ######## |
1088 | # toke.c | |
1089 | use warnings "ambiguous"; | |
1090 | "foo\nn" =~ /^foo$\n/; | |
1091 | "foo\nn" =~ /^foo${\}n/; | |
1092 | my $foo = qr/^foo$\n/; | |
1093 | my $bar = qr/^foo${\}n/; | |
1094 | no warnings "ambiguous"; | |
1095 | "foo\nn" =~ /^foo$\n/; | |
1096 | "foo\nn" =~ /^foo${\}n/; | |
1097 | my $foo = qr/^foo$\n/; | |
1098 | my $bar = qr/^foo${\}n/; | |
1099 | EXPECT | |
1100 | Possible unintended interpolation of $\ in regex at - line 3. | |
1101 | Possible unintended interpolation of $\ in regex at - line 5. | |
d83f38d8 NC |
1102 | ######## |
1103 | # toke.c | |
f0a2b745 KW |
1104 | use warnings 'syntax' ; |
1105 | my $a = "\o"; | |
1106 | my $a = "\o{"; | |
1107 | my $a = "\o{}"; | |
1108 | no warnings 'syntax' ; | |
1109 | my $a = "\o"; | |
1110 | my $a = "\o{"; | |
1111 | my $a = "\o{}"; | |
1112 | EXPECT | |
1113 | Missing braces on \o{} at - line 3, within string | |
1114 | Missing right brace on \o{ at - line 4, within string | |
1115 | Number with no digits at - line 5, within string | |
1116 | BEGIN not safe after errors--compilation aborted at - line 6. | |
1117 | ######## | |
1118 | # toke.c | |
1119 | use warnings 'digit' ; | |
1120 | my $a = "\o{1238456}"; | |
1121 | no warnings 'digit' ; | |
1122 | my $a = "\o{1238456}"; | |
1123 | EXPECT | |
1124 | Non-octal character '8'. Resolved as "\o{123}" at - line 3. | |
725a61d7 Z |
1125 | ######## |
1126 | # toke.c | |
1127 | use warnings; | |
1128 | my $a = "foo"; | |
1129 | print $a =~ ?f? ? "yes\n" : "no\n" foreach 0..2; | |
1130 | EXPECT | |
1131 | Use of ?PATTERN? without explicit operator is deprecated at - line 4. | |
1132 | yes | |
1133 | no | |
1134 | no | |
17a3df4c KW |
1135 | ######## |
1136 | # toke.c | |
1137 | use warnings; | |
1138 | my $a = "\c{ack}"; | |
1139 | $a = "\c,"; | |
1140 | $a = "\c`"; | |
1141 | no warnings 'syntax'; | |
1142 | $a = "\c{ack}"; | |
1143 | $a = "\c,"; | |
1144 | $a = "\c`"; | |
1145 | no warnings 'deprecated'; | |
1146 | EXPECT | |
1147 | "\c{" is deprecated and is more clearly written as ";" at - line 3. | |
1148 | "\c," is more clearly written simply as "l" at - line 4. | |
1149 | "\c`" is more clearly written simply as "\ " at - line 5. | |
1150 | "\c{" is deprecated and is more clearly written as ";" at - line 7. | |
3955e1a9 KW |
1151 | ######## |
1152 | # toke.c | |
1153 | use warnings 'syntax' ; | |
1154 | my $a = qr/foo/du; | |
ff3f26d2 | 1155 | $a = qr/foo/lai; |
3955e1a9 | 1156 | $a = qr/foo/lil; |
ff3f26d2 KW |
1157 | $a = qr/foo/aia; |
1158 | $a = qr/foo/aaia; | |
3955e1a9 KW |
1159 | no warnings 'syntax' ; |
1160 | my $a = qr/foo/du; | |
1161 | EXPECT | |
1162 | Regexp modifiers "/d" and "/u" are mutually exclusive at - line 3, near "= " | |
1163 | Regexp modifiers "/l" and "/a" are mutually exclusive at - line 4, near "= " | |
1164 | Regexp modifier "/l" may not appear twice at - line 5, near "= " | |
ff3f26d2 KW |
1165 | Regexp modifier "/a" may appear a maximum of twice at - line 7, near "= " |
1166 | BEGIN not safe after errors--compilation aborted at - line 8. | |
ba05d9aa FC |
1167 | ######## |
1168 | # toke.c | |
1169 | # [perl #4362] | |
1170 | eval "print q\xabfoo"; | |
1171 | print "ok\n" if | |
1172 | $@ =~ /Can't find string terminator "\xab" anywhere before EOF/; | |
1173 | EXPECT | |
1174 | ok | |
5c66c3dd BF |
1175 | ######## |
1176 | # toke.c | |
1177 | use utf8; | |
1178 | use open qw( :utf8 :std ); | |
1179 | use warnings 'ambiguous' ; | |
1180 | sub frèd {} | |
1181 | $a = ${frèd} ; | |
1182 | no warnings 'ambiguous' ; | |
1183 | $a = ${frèd} ; | |
1184 | EXPECT | |
1185 | Ambiguous use of ${frèd} resolved to $frèd at - line 6. | |
1186 | ######## | |
1187 | # toke.c | |
1188 | use utf8; | |
1189 | use open qw( :utf8 :std ); | |
1190 | use warnings 'ambiguous' ; | |
1191 | sub f렏 {} | |
1192 | $a = ${f렏} ; | |
1193 | no warnings 'ambiguous' ; | |
1194 | $a = ${f렏} ; | |
1195 | EXPECT | |
1196 | Ambiguous use of ${f렏} resolved to $f렏 at - line 6. | |
3773592b BF |
1197 | ######## |
1198 | # toke.c | |
1199 | use utf8; | |
1200 | use open qw( :utf8 :std ); | |
1201 | use warnings; | |
1202 | CORE::렏; | |
1203 | EXPECT | |
1204 | CORE::렏 is not a keyword at - line 5. |