Commit | Line | Data |
---|---|---|
599cee73 PM |
1 | toke.c AOK |
2 | ||
3 | we seem to have lost a few ambiguous warnings!! | |
4 | ||
0b663093 FC |
5 | Prototype after '@' for main::foo |
6 | sub foo (@$) | |
7 | ||
8 | Illegal character in prototype for main::foo | |
9 | sub foo (x) | |
599cee73 PM |
10 | |
11 | \1 better written as $1 | |
4438c4b7 | 12 | use warnings 'syntax' ; |
599cee73 PM |
13 | s/(abc)/\1/; |
14 | ||
15 | warn(warn_nosemi) | |
16 | Semicolon seems to be missing | |
17 | $a = 1 | |
18 | &time ; | |
19 | ||
20 | ||
21 | Reversed %c= operator | |
22 | my $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 | $a =/ 2 ; | |
32 | ||
33 | Multidimensional syntax %.*s not supported | |
34 | my $a = $a[1,2] ; | |
35 | ||
36 | You need to quote \"%s\"" | |
37 | sub fred {} ; $SIG{TERM} = fred; | |
38 | ||
599cee73 PM |
39 | Can't use \\%c to mean $%c in expression |
40 | $_ = "ab" ; s/(ab)/\1/e; | |
41 | ||
42 | Unquoted string "abc" may clash with future reserved word at - line 3. | |
43 | warn(warn_reserved | |
44 | $a = abc; | |
45 | ||
599cee73 PM |
46 | Possible attempt to separate words with commas |
47 | @a = qw(a, b, c) ; | |
48 | ||
49 | Possible attempt to put comments in qw() list | |
50 | @a = qw(a b # c) ; | |
51 | ||
599cee73 PM |
52 | %s (...) interpreted as function |
53 | print ("") | |
54 | printf ("") | |
55 | sort ("") | |
56 | ||
57 | Ambiguous use of %c{%s%s} resolved to %c%s%s | |
58 | $a = ${time[2]} | |
59 | $a = ${time{2}} | |
60 | ||
61 | ||
62 | Ambiguous use of %c{%s} resolved to %c%s | |
63 | $a = ${time} | |
64 | sub fred {} $a = ${fred} | |
65 | ||
66 | Misplaced _ in number | |
67 | $a = 1_2; | |
68 | $a = 1_2345_6; | |
69 | ||
70 | Bareword \"%s\" refers to nonexistent package | |
71 | $a = FRED:: ; | |
72 | ||
73 | Ambiguous call resolved as CORE::%s(), qualify as such or use & | |
74 | sub time {} | |
75 | my $a = time() | |
76 | ||
767a6a26 PM |
77 | Unrecognized escape \\%c passed through |
78 | $a = "\m" ; | |
79 | ||
820438b1 | 80 | Useless use of \\E. |
52ed07f6 BF |
81 | $a = "abcd\E" ; |
82 | ||
1f25714a FC |
83 | Postfix dereference is experimental |
84 | ||
767a6a26 PM |
85 | %s number > %s non-portable |
86 | my $a = 0b011111111111111111111111111111110 ; | |
87 | $a = 0b011111111111111111111111111111111 ; | |
88 | $a = 0b111111111111111111111111111111111 ; | |
89 | $a = 0x0fffffffe ; | |
90 | $a = 0x0ffffffff ; | |
91 | $a = 0x1ffffffff ; | |
92 | $a = 0037777777776 ; | |
93 | $a = 0037777777777 ; | |
94 | $a = 0047777777777 ; | |
95 | ||
96 | Integer overflow in binary number | |
97 | my $a = 0b011111111111111111111111111111110 ; | |
98 | $a = 0b011111111111111111111111111111111 ; | |
99 | $a = 0b111111111111111111111111111111111 ; | |
100 | $a = 0x0fffffffe ; | |
101 | $a = 0x0ffffffff ; | |
102 | $a = 0x1ffffffff ; | |
103 | $a = 0037777777776 ; | |
104 | $a = 0037777777777 ; | |
105 | $a = 0047777777777 ; | |
ac206dc8 RGS |
106 | |
107 | dump() better written as CORE::dump() | |
4ac733c9 MJD |
108 | |
109 | Use of /c modifier is meaningless without /g | |
110 | ||
64e578a2 MJD |
111 | Use of /c modifier is meaningless in s/// |
112 | ||
0453d815 PM |
113 | Mandatory Warnings |
114 | ------------------ | |
115 | Use of "%s" without parentheses is ambiguous [check_uni] | |
116 | rand + 4 | |
117 | ||
118 | Ambiguous use of -%s resolved as -&%s() [yylex] | |
119 | sub fred {} ; - fred ; | |
120 | ||
121 | Precedence problem: open %.*s should be open(%.*s) [yylex] | |
122 | open FOO || die; | |
123 | ||
124 | Operator or semicolon missing before %c%s [yylex] | |
125 | Ambiguous use of %c resolved as operator %c | |
126 | *foo *foo | |
127 | ||
599cee73 | 128 | __END__ |
0b663093 FC |
129 | use utf8; |
130 | use open qw( :utf8 :std ); | |
131 | use warnings; | |
132 | eval "sub fòò (@\$\0) {}"; | |
133 | EXPECT | |
134 | Prototype after '@' for main::fòò : @$\0 at (eval 1) line 1. | |
135 | Illegal character in prototype for main::fòò : @$\0 at (eval 1) line 1. | |
136 | ######## | |
137 | use utf8; | |
138 | use open qw( :utf8 :std ); | |
139 | use warnings; | |
140 | eval "sub foo (@\0) {}"; | |
141 | EXPECT | |
142 | Prototype after '@' for main::foo : @\0 at (eval 1) line 1. | |
143 | Illegal character in prototype for main::foo : @\0 at (eval 1) line 1. | |
144 | ######## | |
145 | BEGIN { | |
146 | if (ord('A') == 193) { | |
147 | print "SKIPPED\n# Different results on EBCDIC"; | |
148 | exit 0; | |
149 | } | |
150 | } | |
151 | use utf8; | |
152 | use open qw( :utf8 :std ); | |
153 | use warnings; | |
154 | BEGIN { $::{"foo"} = "\@\$\0L\351on" } | |
155 | BEGIN { eval "sub foo (@\$\0L\x{c3}\x{a9}on) {}"; } | |
156 | EXPECT | |
157 | Prototype after '@' for main::foo : @$\x{0}L... at (eval 1) line 1. | |
158 | Illegal character in prototype for main::foo : @$\x{0}L... at (eval 1) line 1. | |
159 | ######## | |
160 | use utf8; | |
161 | use open qw( :utf8 :std ); | |
162 | use warnings; | |
163 | BEGIN { eval "sub foo (@\0) {}"; } | |
164 | EXPECT | |
165 | Prototype after '@' for main::foo : @\0 at (eval 1) line 1. | |
166 | Illegal character in prototype for main::foo : @\0 at (eval 1) line 1. | |
167 | ######## | |
168 | use warnings; | |
169 | eval "sub foo (@\xAB) {}"; | |
170 | EXPECT | |
171 | Prototype after '@' for main::foo : @\x{ab} at (eval 1) line 1. | |
172 | Illegal character in prototype for main::foo : @\x{ab} at (eval 1) line 1. | |
173 | ######## | |
174 | use utf8; | |
175 | use open qw( :utf8 :std ); | |
176 | use warnings; | |
177 | BEGIN { eval "sub foo (@\x{30cb}) {}"; } | |
178 | EXPECT | |
179 | Prototype after '@' for main::foo : @\x{30cb} at (eval 1) line 1. | |
180 | Illegal character in prototype for main::foo : @\x{30cb} at (eval 1) line 1. | |
181 | ######## | |
599cee73 | 182 | # toke.c |
0da72d5e KW |
183 | $a =~ m/$foo/eq; |
184 | $a =~ s/$foo/fool/seq; | |
185 | ||
186 | EXPECT | |
187 | OPTION fatal | |
188 | Unknown regexp modifier "/e" at - line 2, near "=~ " | |
189 | Unknown regexp modifier "/q" at - line 2, near "=~ " | |
190 | Unknown regexp modifier "/q" at - line 3, near "=~ " | |
191 | Execution of - aborted due to compilation errors. | |
84159251 BF |
192 | ######## |
193 | # toke.c | |
194 | use utf8; | |
195 | use open qw( :utf8 :std ); | |
196 | $a =~ m/$foo/eネq; | |
197 | $a =~ s/$foo/fool/seネq; | |
198 | ||
199 | EXPECT | |
200 | OPTION fatal | |
201 | Unknown regexp modifier "/e" at - line 4, near "=~ " | |
202 | Unknown regexp modifier "/ネ" at - line 4, near "=~ " | |
203 | Unknown regexp modifier "/q" at - line 4, near "=~ " | |
204 | Unknown regexp modifier "/ネ" at - line 5, near "=~ " | |
205 | Unknown regexp modifier "/q" at - line 5, near "=~ " | |
206 | Execution of - aborted due to compilation errors. | |
599cee73 PM |
207 | ######## |
208 | # toke.c | |
4438c4b7 | 209 | use warnings 'syntax' ; |
599cee73 | 210 | s/(abc)/\1/; |
4438c4b7 | 211 | no warnings 'syntax' ; |
0453d815 | 212 | s/(abc)/\1/; |
599cee73 PM |
213 | EXPECT |
214 | \1 better written as $1 at - line 3. | |
215 | ######## | |
216 | # toke.c | |
4438c4b7 | 217 | use warnings 'semicolon' ; |
599cee73 PM |
218 | $a = 1 |
219 | &time ; | |
4438c4b7 | 220 | no warnings 'semicolon' ; |
0453d815 PM |
221 | $a = 1 |
222 | &time ; | |
599cee73 PM |
223 | EXPECT |
224 | Semicolon seems to be missing at - line 3. | |
225 | ######## | |
226 | # toke.c | |
4438c4b7 | 227 | use warnings 'syntax' ; |
599cee73 PM |
228 | my $a =+ 2 ; |
229 | $a =- 2 ; | |
230 | $a =* 2 ; | |
231 | $a =% 2 ; | |
232 | $a =& 2 ; | |
233 | $a =. 2 ; | |
234 | $a =^ 2 ; | |
235 | $a =| 2 ; | |
236 | $a =< 2 ; | |
237 | $a =/ 2 ; | |
238 | EXPECT | |
7f01dc7a JH |
239 | Reversed += operator at - line 3. |
240 | Reversed -= operator at - line 4. | |
241 | Reversed *= operator at - line 5. | |
242 | Reversed %= operator at - line 6. | |
243 | Reversed &= operator at - line 7. | |
244 | Reversed .= operator at - line 8. | |
245 | Reversed ^= operator at - line 9. | |
246 | Reversed |= operator at - line 10. | |
247 | Reversed <= operator at - line 11. | |
248 | syntax error at - line 8, near "=." | |
249 | syntax error at - line 9, near "=^" | |
250 | syntax error at - line 10, near "=|" | |
251 | Unterminated <> operator at - line 11. | |
599cee73 PM |
252 | ######## |
253 | # toke.c | |
4438c4b7 | 254 | no warnings 'syntax' ; |
0453d815 PM |
255 | my $a =+ 2 ; |
256 | $a =- 2 ; | |
257 | $a =* 2 ; | |
258 | $a =% 2 ; | |
259 | $a =& 2 ; | |
260 | $a =. 2 ; | |
261 | $a =^ 2 ; | |
262 | $a =| 2 ; | |
263 | $a =< 2 ; | |
264 | $a =/ 2 ; | |
265 | EXPECT | |
7f01dc7a JH |
266 | syntax error at - line 8, near "=." |
267 | syntax error at - line 9, near "=^" | |
268 | syntax error at - line 10, near "=|" | |
269 | Unterminated <> operator at - line 11. | |
0453d815 PM |
270 | ######## |
271 | # toke.c | |
4438c4b7 | 272 | use warnings 'syntax' ; |
599cee73 | 273 | my $a = $a[1,2] ; |
4438c4b7 | 274 | no warnings 'syntax' ; |
0453d815 | 275 | my $a = $a[1,2] ; |
599cee73 PM |
276 | EXPECT |
277 | Multidimensional syntax $a[1,2] not supported at - line 3. | |
278 | ######## | |
279 | # toke.c | |
4438c4b7 | 280 | use warnings 'syntax' ; |
599cee73 | 281 | sub fred {} ; $SIG{TERM} = fred; |
4438c4b7 | 282 | no warnings 'syntax' ; |
0453d815 | 283 | $SIG{TERM} = fred; |
599cee73 PM |
284 | EXPECT |
285 | You need to quote "fred" at - line 3. | |
286 | ######## | |
287 | # toke.c | |
4c01a014 BF |
288 | use utf8; |
289 | use open qw( :utf8 :std ); | |
290 | use warnings 'syntax' ; | |
291 | sub frèd {} ; $SIG{TERM} = frèd; | |
292 | no warnings 'syntax' ; | |
293 | $SIG{TERM} = frèd; | |
294 | EXPECT | |
295 | You need to quote "frèd" at - line 5. | |
296 | ######## | |
297 | # toke.c | |
298 | use utf8; | |
299 | use open qw( :utf8 :std ); | |
300 | use warnings 'syntax' ; | |
301 | sub ふれど {} ; $SIG{TERM} = ふれど; | |
302 | no warnings 'syntax' ; | |
303 | $SIG{TERM} = ふれど; | |
304 | EXPECT | |
305 | You need to quote "ふれど" at - line 5. | |
306 | ######## | |
307 | # toke.c | |
4438c4b7 | 308 | use warnings 'syntax' ; |
599cee73 PM |
309 | $_ = "ab" ; |
310 | s/(ab)/\1/e; | |
e37958c3 FC |
311 | s//\(2)/e; # should be exempt |
312 | s/${\2}//; # same here | |
313 | ()="${\2}"; # metoo | |
4438c4b7 | 314 | no warnings 'syntax' ; |
0453d815 PM |
315 | $_ = "ab" ; |
316 | s/(ab)/\1/e; | |
599cee73 PM |
317 | EXPECT |
318 | Can't use \1 to mean $1 in expression at - line 4. | |
319 | ######## | |
320 | # toke.c | |
4438c4b7 | 321 | use warnings 'reserved' ; |
599cee73 | 322 | $a = abc; |
1c3923b3 GS |
323 | $a = { def |
324 | ||
325 | => 1 }; | |
4438c4b7 | 326 | no warnings 'reserved' ; |
0453d815 | 327 | $a = abc; |
599cee73 PM |
328 | EXPECT |
329 | Unquoted string "abc" may clash with future reserved word at - line 3. | |
330 | ######## | |
331 | # toke.c | |
e476b1b5 | 332 | use warnings 'qw' ; |
599cee73 | 333 | @a = qw(a, b, c) ; |
e476b1b5 | 334 | no warnings 'qw' ; |
0453d815 | 335 | @a = qw(a, b, c) ; |
599cee73 PM |
336 | EXPECT |
337 | Possible attempt to separate words with commas at - line 3. | |
338 | ######## | |
339 | # toke.c | |
e476b1b5 | 340 | use warnings 'qw' ; |
7e03b518 | 341 | @a = qw(a b c # #) ; |
e476b1b5 | 342 | no warnings 'qw' ; |
7e03b518 | 343 | @a = qw(a b c # #) ; |
599cee73 PM |
344 | EXPECT |
345 | Possible attempt to put comments in qw() list at - line 3. | |
346 | ######## | |
347 | # toke.c | |
7e03b518 EB |
348 | use warnings 'qw' ; |
349 | @a = qw(a, b, c # #) ; | |
350 | no warnings 'qw' ; | |
351 | @a = qw(a, b, c # #) ; | |
352 | EXPECT | |
353 | Possible attempt to separate words with commas at - line 3. | |
354 | Possible attempt to put comments in qw() list at - line 3. | |
355 | ######## | |
356 | # toke.c | |
4438c4b7 | 357 | use warnings 'syntax' ; |
b1439985 RGS |
358 | print (""); |
359 | print ("") and $x = 1; | |
360 | print ("") or die; | |
361 | print ("") // die; | |
362 | print (1+2) * 3 if 0; # only this one should warn | |
363 | print (1+2) if 0; | |
599cee73 | 364 | EXPECT |
b1439985 | 365 | print (...) interpreted as function at - line 7. |
599cee73 PM |
366 | ######## |
367 | # toke.c | |
4438c4b7 | 368 | no warnings 'syntax' ; |
0453d815 PM |
369 | print ("") |
370 | EXPECT | |
371 | ||
372 | ######## | |
373 | # toke.c | |
4438c4b7 | 374 | use warnings 'syntax' ; |
b1439985 RGS |
375 | printf (""); |
376 | printf ("") . ''; | |
599cee73 | 377 | EXPECT |
b1439985 | 378 | printf (...) interpreted as function at - line 4. |
599cee73 PM |
379 | ######## |
380 | # toke.c | |
4438c4b7 | 381 | no warnings 'syntax' ; |
0453d815 PM |
382 | printf ("") |
383 | EXPECT | |
384 | ||
385 | ######## | |
386 | # toke.c | |
4438c4b7 | 387 | use warnings 'syntax' ; |
b1439985 RGS |
388 | sort (""); |
389 | sort ("") . ''; | |
599cee73 | 390 | EXPECT |
b1439985 | 391 | sort (...) interpreted as function at - line 4. |
599cee73 PM |
392 | ######## |
393 | # toke.c | |
4438c4b7 | 394 | no warnings 'syntax' ; |
0453d815 PM |
395 | sort ("") |
396 | EXPECT | |
397 | ||
398 | ######## | |
399 | # toke.c | |
4438c4b7 | 400 | use warnings 'ambiguous' ; |
599cee73 | 401 | $a = ${time[2]}; |
4438c4b7 | 402 | no warnings 'ambiguous' ; |
0453d815 | 403 | $a = ${time[2]}; |
599cee73 PM |
404 | EXPECT |
405 | Ambiguous use of ${time[...]} resolved to $time[...] at - line 3. | |
406 | ######## | |
407 | # toke.c | |
4438c4b7 | 408 | use warnings 'ambiguous' ; |
599cee73 PM |
409 | $a = ${time{2}}; |
410 | EXPECT | |
411 | Ambiguous use of ${time{...}} resolved to $time{...} at - line 3. | |
412 | ######## | |
413 | # toke.c | |
a49b10d0 BF |
414 | use warnings 'ambiguous' ; |
415 | $a = ${ | |
416 | ||
417 | time | |
418 | {2} | |
419 | }; | |
420 | warn "after"; | |
421 | EXPECT | |
422 | Ambiguous use of ${time{...}} resolved to $time{...} at - line 5. | |
423 | after at - line 8. | |
424 | ######## | |
425 | # toke.c | |
426 | use warnings 'ambiguous' ; | |
427 | $a = ${ | |
428 | ||
429 | time[2] | |
430 | ||
431 | }; | |
432 | $a = ${ | |
433 | ||
434 | time | |
435 | [2] | |
436 | ||
437 | }; | |
438 | warn "after"; | |
439 | EXPECT | |
440 | Ambiguous use of ${time[...]} resolved to $time[...] at - line 5. | |
441 | Ambiguous use of ${time[...]} resolved to $time[...] at - line 10. | |
442 | after at - line 14. | |
443 | ######## | |
444 | # toke.c | |
4438c4b7 | 445 | no warnings 'ambiguous' ; |
0453d815 PM |
446 | $a = ${time{2}}; |
447 | EXPECT | |
448 | ||
449 | ######## | |
450 | # toke.c | |
4438c4b7 | 451 | use warnings 'ambiguous' ; |
599cee73 | 452 | $a = ${time} ; |
27ffb73a NC |
453 | $a = @{time} ; |
454 | $a = $#{time} ; # This one is special cased in toke.c | |
455 | $a = %{time} ; | |
456 | $a = *{time} ; | |
457 | $a = defined &{time} ; # To avoid calling &::time | |
4438c4b7 | 458 | no warnings 'ambiguous' ; |
0453d815 | 459 | $a = ${time} ; |
27ffb73a NC |
460 | $a = @{time} ; |
461 | $a = $#{time} ; # This one is special cased in toke.c | |
462 | $a = %{time} ; | |
463 | $a = *{time} ; | |
464 | $a = defined &{time} ; # To avoid calling &::time | |
599cee73 PM |
465 | EXPECT |
466 | Ambiguous use of ${time} resolved to $time at - line 3. | |
27ffb73a NC |
467 | Ambiguous use of @{time} resolved to @time at - line 4. |
468 | Ambiguous use of @{time} resolved to @time at - line 5. | |
469 | Ambiguous use of %{time} resolved to %time at - line 6. | |
470 | Ambiguous use of *{time} resolved to *time at - line 7. | |
471 | Ambiguous use of &{time} resolved to &time at - line 8. | |
599cee73 PM |
472 | ######## |
473 | # toke.c | |
4438c4b7 | 474 | use warnings 'ambiguous' ; |
a49b10d0 BF |
475 | $a = ${ |
476 | time | |
477 | } ; | |
478 | $a = @{ | |
479 | time | |
480 | } ; | |
481 | $a = $#{ | |
482 | time | |
483 | } ; | |
484 | $a = %{ | |
485 | time | |
486 | } ; | |
487 | $a = *{ | |
488 | time | |
489 | } ; | |
490 | $a = defined &{ | |
491 | time | |
492 | ||
493 | ||
494 | } ; | |
495 | warn "last"; | |
496 | EXPECT | |
497 | Ambiguous use of ${time} resolved to $time at - line 4. | |
498 | Ambiguous use of @{time} resolved to @time at - line 7. | |
499 | Ambiguous use of @{time} resolved to @time at - line 10. | |
500 | Ambiguous use of %{time} resolved to %time at - line 13. | |
501 | Ambiguous use of *{time} resolved to *time at - line 16. | |
502 | Ambiguous use of &{time} resolved to &time at - line 19. | |
503 | last at - line 23. | |
504 | ######## | |
505 | # toke.c | |
506 | use warnings 'ambiguous' ; | |
599cee73 PM |
507 | sub fred {} |
508 | $a = ${fred} ; | |
4438c4b7 | 509 | no warnings 'ambiguous' ; |
0453d815 | 510 | $a = ${fred} ; |
599cee73 PM |
511 | EXPECT |
512 | Ambiguous use of ${fred} resolved to $fred at - line 4. | |
513 | ######## | |
514 | # toke.c | |
4438c4b7 | 515 | use warnings 'syntax' ; |
7fd134d9 JH |
516 | $a = _123; print "$a\n"; #( 3 string) |
517 | $a = 1_23; print "$a\n"; | |
518 | $a = 12_3; print "$a\n"; | |
519 | $a = 123_; print "$a\n"; # 6 | |
520 | $a = _+123; print "$a\n"; # 7 string) | |
521 | $a = +_123; print "$a\n"; #( 8 string) | |
522 | $a = +1_23; print "$a\n"; | |
523 | $a = +12_3; print "$a\n"; | |
524 | $a = +123_; print "$a\n"; # 11 | |
525 | $a = _-123; print "$a\n"; #(12 string) | |
526 | $a = -_123; print "$a\n"; #(13 string) | |
527 | $a = -1_23; print "$a\n"; | |
528 | $a = -12_3; print "$a\n"; | |
529 | $a = -123_; print "$a\n"; # 16 | |
530 | $a = 123._456; print "$a\n"; # 17 | |
531 | $a = 123.4_56; print "$a\n"; | |
532 | $a = 123.45_6; print "$a\n"; | |
533 | $a = 123.456_; print "$a\n"; # 20 | |
534 | $a = +123._456; print "$a\n"; # 21 | |
535 | $a = +123.4_56; print "$a\n"; | |
536 | $a = +123.45_6; print "$a\n"; | |
537 | $a = +123.456_; print "$a\n"; # 24 | |
538 | $a = -123._456; print "$a\n"; # 25 | |
539 | $a = -123.4_56; print "$a\n"; | |
540 | $a = -123.45_6; print "$a\n"; | |
541 | $a = -123.456_; print "$a\n"; # 28 | |
2bea9a37 JH |
542 | $a = 123.456E_12; printf("%.0f\n", $a); # 29 |
543 | $a = 123.456E1_2; printf("%.0f\n", $a); | |
544 | $a = 123.456E12_; printf("%.0f\n", $a); # 31 | |
545 | $a = 123.456E_+12; printf("%.0f\n", $a); # 32 | |
546 | $a = 123.456E+_12; printf("%.0f\n", $a); # 33 | |
547 | $a = 123.456E+1_2; printf("%.0f\n", $a); | |
548 | $a = 123.456E+12_; printf("%.0f\n", $a); # 35 | |
7fd134d9 JH |
549 | $a = 123.456E_-12; print "$a\n"; # 36 |
550 | $a = 123.456E-_12; print "$a\n"; # 37 | |
551 | $a = 123.456E-1_2; print "$a\n"; | |
552 | $a = 123.456E-12_; print "$a\n"; # 39 | |
b3b48e3e JH |
553 | $a = 1__23; print "$a\n"; # 40 |
554 | $a = 12.3__4; print "$a\n"; # 41 | |
2bea9a37 | 555 | $a = 12.34e1__2; printf("%.0f\n", $a); # 42 |
4438c4b7 | 556 | no warnings 'syntax' ; |
7fd134d9 JH |
557 | $a = _123; print "$a\n"; |
558 | $a = 1_23; print "$a\n"; | |
559 | $a = 12_3; print "$a\n"; | |
560 | $a = 123_; print "$a\n"; | |
561 | $a = _+123; print "$a\n"; | |
562 | $a = +_123; print "$a\n"; | |
563 | $a = +1_23; print "$a\n"; | |
564 | $a = +12_3; print "$a\n"; | |
565 | $a = +123_; print "$a\n"; | |
566 | $a = _-123; print "$a\n"; | |
567 | $a = -_123; print "$a\n"; | |
568 | $a = -1_23; print "$a\n"; | |
569 | $a = -12_3; print "$a\n"; | |
570 | $a = -123_; print "$a\n"; | |
571 | $a = 123._456; print "$a\n"; | |
572 | $a = 123.4_56; print "$a\n"; | |
573 | $a = 123.45_6; print "$a\n"; | |
574 | $a = 123.456_; print "$a\n"; | |
575 | $a = +123._456; print "$a\n"; | |
576 | $a = +123.4_56; print "$a\n"; | |
577 | $a = +123.45_6; print "$a\n"; | |
578 | $a = +123.456_; print "$a\n"; | |
579 | $a = -123._456; print "$a\n"; | |
580 | $a = -123.4_56; print "$a\n"; | |
581 | $a = -123.45_6; print "$a\n"; | |
582 | $a = -123.456_; print "$a\n"; | |
2bea9a37 JH |
583 | $a = 123.456E_12; printf("%.0f\n", $a); |
584 | $a = 123.456E1_2; printf("%.0f\n", $a); | |
585 | $a = 123.456E12_; printf("%.0f\n", $a); | |
586 | $a = 123.456E_+12; printf("%.0f\n", $a); | |
587 | $a = 123.456E+_12; printf("%.0f\n", $a); | |
588 | $a = 123.456E+1_2; printf("%.0f\n", $a); | |
589 | $a = 123.456E+12_; printf("%.0f\n", $a); | |
7fd134d9 JH |
590 | $a = 123.456E_-12; print "$a\n"; |
591 | $a = 123.456E-_12; print "$a\n"; | |
592 | $a = 123.456E-1_2; print "$a\n"; | |
593 | $a = 123.456E-12_; print "$a\n"; | |
b3b48e3e JH |
594 | $a = 1__23; print "$a\n"; |
595 | $a = 12.3__4; print "$a\n"; | |
2bea9a37 | 596 | $a = 12.34e1__2; printf("%.0f\n", $a); |
599cee73 | 597 | EXPECT |
fbfa96bd | 598 | OPTIONS regex |
928753ea | 599 | Misplaced _ in number at - line 6. |
928753ea | 600 | Misplaced _ in number at - line 11. |
7fd134d9 | 601 | Misplaced _ in number at - line 16. |
928753ea | 602 | Misplaced _ in number at - line 17. |
7fd134d9 | 603 | Misplaced _ in number at - line 20. |
928753ea | 604 | Misplaced _ in number at - line 21. |
7fd134d9 JH |
605 | Misplaced _ in number at - line 24. |
606 | Misplaced _ in number at - line 25. | |
607 | Misplaced _ in number at - line 28. | |
608 | Misplaced _ in number at - line 29. | |
609 | Misplaced _ in number at - line 31. | |
610 | Misplaced _ in number at - line 32. | |
611 | Misplaced _ in number at - line 33. | |
612 | Misplaced _ in number at - line 35. | |
613 | Misplaced _ in number at - line 36. | |
614 | Misplaced _ in number at - line 37. | |
615 | Misplaced _ in number at - line 39. | |
b3b48e3e JH |
616 | Misplaced _ in number at - line 40. |
617 | Misplaced _ in number at - line 41. | |
618 | Misplaced _ in number at - line 42. | |
928753ea JH |
619 | _123 |
620 | 123 | |
928753ea | 621 | 123 |
7fd134d9 JH |
622 | 123 |
623 | 123 | |
624 | _123 | |
625 | 123 | |
626 | 123 | |
627 | 123 | |
628 | -123 | |
629 | -_123 | |
630 | -123 | |
631 | -123 | |
632 | -123 | |
633 | 123.456 | |
634 | 123.456 | |
635 | 123.456 | |
636 | 123.456 | |
637 | 123.456 | |
638 | 123.456 | |
639 | 123.456 | |
640 | 123.456 | |
641 | -123.456 | |
642 | -123.456 | |
643 | -123.456 | |
644 | -123.456 | |
645 | 123456000000000 | |
646 | 123456000000000 | |
647 | 123456000000000 | |
648 | 123456000000000 | |
649 | 123456000000000 | |
650 | 123456000000000 | |
651 | 123456000000000 | |
fbfa96bd NIS |
652 | 1.23456e-0?10 |
653 | 1.23456e-0?10 | |
654 | 1.23456e-0?10 | |
655 | 1.23456e-0?10 | |
b3b48e3e JH |
656 | 123 |
657 | 12.34 | |
658 | 12340000000000 | |
7fd134d9 JH |
659 | _123 |
660 | 123 | |
661 | 123 | |
662 | 123 | |
663 | 123 | |
664 | _123 | |
665 | 123 | |
666 | 123 | |
667 | 123 | |
668 | -123 | |
669 | -_123 | |
670 | -123 | |
671 | -123 | |
672 | -123 | |
673 | 123.456 | |
674 | 123.456 | |
675 | 123.456 | |
676 | 123.456 | |
677 | 123.456 | |
928753ea JH |
678 | 123.456 |
679 | 123.456 | |
928753ea | 680 | 123.456 |
7fd134d9 JH |
681 | -123.456 |
682 | -123.456 | |
683 | -123.456 | |
684 | -123.456 | |
685 | 123456000000000 | |
686 | 123456000000000 | |
687 | 123456000000000 | |
688 | 123456000000000 | |
689 | 123456000000000 | |
690 | 123456000000000 | |
691 | 123456000000000 | |
fbfa96bd NIS |
692 | 1.23456e-0?10 |
693 | 1.23456e-0?10 | |
694 | 1.23456e-0?10 | |
695 | 1.23456e-0?10 | |
b3b48e3e JH |
696 | 123 |
697 | 12.34 | |
698 | 12340000000000 | |
599cee73 PM |
699 | ######## |
700 | # toke.c | |
72c80c74 Z |
701 | use warnings 'syntax'; |
702 | $a = 1_; print "$a\n"; | |
703 | $a = 01_; print "$a\n"; | |
704 | $a = 0_; print "$a\n"; | |
705 | $a = 0x1_; print "$a\n"; | |
706 | $a = 0x_; print "$a\n"; | |
707 | $a = 1.2_; print "$a\n"; | |
708 | $a = 1._2; print "$a\n"; | |
709 | $a = 1._; print "$a\n"; | |
710 | EXPECT | |
711 | Misplaced _ in number at - line 3. | |
712 | Misplaced _ in number at - line 4. | |
713 | Misplaced _ in number at - line 5. | |
714 | Misplaced _ in number at - line 6. | |
715 | Misplaced _ in number at - line 7. | |
716 | Misplaced _ in number at - line 8. | |
717 | Misplaced _ in number at - line 9. | |
718 | Misplaced _ in number at - line 10. | |
719 | 1 | |
720 | 1 | |
721 | 0 | |
722 | 1 | |
723 | 0 | |
724 | 1.2 | |
725 | 1.2 | |
726 | 1 | |
727 | ######## | |
728 | # toke.c | |
e476b1b5 | 729 | use warnings 'bareword' ; |
60e6418e | 730 | #line 25 "bar" |
599cee73 | 731 | $a = FRED:: ; |
e476b1b5 | 732 | no warnings 'bareword' ; |
0453d815 PM |
733 | #line 25 "bar" |
734 | $a = FRED:: ; | |
599cee73 | 735 | EXPECT |
60e6418e | 736 | Bareword "FRED::" refers to nonexistent package at bar line 25. |
979a1401 BF |
737 | ######## |
738 | # toke.c | |
739 | use utf8; | |
740 | use open qw( :utf8 :std ); | |
741 | use warnings 'bareword' ; | |
742 | #line 25 "bar" | |
743 | $a = FRÈD:: ; | |
744 | no warnings 'bareword' ; | |
745 | #line 25 "bar" | |
746 | $a = FRÈD:: ; | |
747 | EXPECT | |
748 | Bareword "FRÈD::" refers to nonexistent package at bar line 25. | |
749 | ######## | |
750 | # toke.c | |
751 | use utf8; | |
752 | use open qw( :utf8 :std ); | |
753 | use warnings 'bareword' ; | |
754 | #line 25 "bar" | |
755 | $a = ϞϞϞ:: ; | |
756 | no warnings 'bareword' ; | |
757 | #line 25 "bar" | |
758 | $a = ϞϞϞ:: ; | |
759 | EXPECT | |
760 | Bareword "ϞϞϞ::" refers to nonexistent package at bar line 25. | |
599cee73 PM |
761 | ######## |
762 | # toke.c | |
4438c4b7 | 763 | use warnings 'ambiguous' ; |
599cee73 | 764 | sub time {} |
0453d815 | 765 | my $a = time() ; |
4438c4b7 | 766 | no warnings 'ambiguous' ; |
0453d815 | 767 | my $b = time() ; |
599cee73 PM |
768 | EXPECT |
769 | Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4. | |
770 | ######## | |
771 | # toke.c | |
26d16222 | 772 | use warnings ; |
0453d815 | 773 | eval <<'EOE'; |
df0deb90 GS |
774 | # line 30 "foo" |
775 | warn "yelp"; | |
0453d815 | 776 | { |
0453d815 PM |
777 | $_ = " \x{123} " ; |
778 | } | |
779 | EOE | |
780 | EXPECT | |
df0deb90 | 781 | yelp at foo line 30. |
0453d815 PM |
782 | ######## |
783 | # toke.c | |
0453d815 | 784 | my $a = rand + 4 ; |
fbdd83da DIM |
785 | $a = rand *^H ; |
786 | $a = rand $^H ; | |
0453d815 | 787 | EXPECT |
2d5ccbba | 788 | Warning: Use of "rand" without parentheses is ambiguous at - line 2. |
0453d815 PM |
789 | ######## |
790 | # toke.c | |
791 | $^W = 0 ; | |
792 | my $a = rand + 4 ; | |
793 | { | |
4438c4b7 | 794 | no warnings 'ambiguous' ; |
0453d815 | 795 | $a = rand + 4 ; |
4438c4b7 | 796 | use warnings 'ambiguous' ; |
0453d815 PM |
797 | $a = rand + 4 ; |
798 | } | |
799 | $a = rand + 4 ; | |
800 | EXPECT | |
2d5ccbba IT |
801 | Warning: Use of "rand" without parentheses is ambiguous at - line 3. |
802 | Warning: Use of "rand" without parentheses is ambiguous at - line 8. | |
803 | Warning: Use of "rand" without parentheses is ambiguous at - line 10. | |
0453d815 | 804 | ######## |
e19a021b FC |
805 | # [perl #97110] |
806 | sub myrand(;$) { } | |
b5fb7ce3 | 807 | sub whatever($) { } |
e19a021b | 808 | my $a = myrand + 4 ; |
b5fb7ce3 | 809 | my $b = whatever + 4 ; |
e19a021b | 810 | EXPECT |
b5fb7ce3 | 811 | Warning: Use of "myrand" without parentheses is ambiguous at - line 4. |
e19a021b | 812 | ######## |
0453d815 | 813 | # toke.c |
e8ae98db RGS |
814 | use warnings "ambiguous"; |
815 | print for keys %+; # should not warn | |
816 | EXPECT | |
817 | ######## | |
7950e9cf | 818 | # toke.c [This does not warn any more.] |
0453d815 PM |
819 | sub fred {}; |
820 | -fred ; | |
898c3bca FC |
821 | sub hank : lvalue {$_} |
822 | --hank; # This should *not* warn [perl #77240] | |
0453d815 | 823 | EXPECT |
0453d815 | 824 | ######## |
7950e9cf | 825 | # toke.c [This does not warn any more.] |
0453d815 PM |
826 | $^W = 0 ; |
827 | sub fred {} ; | |
828 | -fred ; | |
829 | { | |
4438c4b7 | 830 | no warnings 'ambiguous' ; |
0453d815 | 831 | -fred ; |
4438c4b7 | 832 | use warnings 'ambiguous' ; |
0453d815 PM |
833 | -fred ; |
834 | } | |
835 | -fred ; | |
836 | EXPECT | |
0453d815 | 837 | ######## |
7950e9cf | 838 | # toke.c [This does not warn any more.] |
43b5ab4c BF |
839 | use utf8; |
840 | use open qw( :utf8 :std ); | |
841 | sub frèd {}; | |
842 | -frèd ; | |
843 | EXPECT | |
43b5ab4c | 844 | ######## |
7950e9cf | 845 | # toke.c [This does not warn any more.] |
43b5ab4c BF |
846 | $^W = 0 ; |
847 | use utf8; | |
848 | use open qw( :utf8 :std ); | |
849 | sub frèd {} ; | |
850 | -frèd ; | |
851 | { | |
852 | no warnings 'ambiguous' ; | |
853 | -frèd ; | |
854 | use warnings 'ambiguous' ; | |
855 | -frèd ; | |
856 | } | |
857 | -frèd ; | |
858 | EXPECT | |
43b5ab4c | 859 | ######## |
7950e9cf | 860 | # toke.c [This does not warn any more.] |
43b5ab4c BF |
861 | use utf8; |
862 | use open qw( :utf8 :std ); | |
863 | sub ᒍᒘᒊ {}; | |
864 | -ᒍᒘᒊ ; | |
865 | EXPECT | |
43b5ab4c | 866 | ######## |
7950e9cf | 867 | # toke.c [This does not warn any more.] |
43b5ab4c BF |
868 | $^W = 0 ; |
869 | use utf8; | |
870 | use open qw( :utf8 :std ); | |
871 | sub ᒍᒘᒊ {} ; | |
872 | -ᒍᒘᒊ ; | |
873 | { | |
874 | no warnings 'ambiguous' ; | |
875 | -ᒍᒘᒊ ; | |
876 | use warnings 'ambiguous' ; | |
877 | -ᒍᒘᒊ ; | |
878 | } | |
879 | -ᒍᒘᒊ ; | |
880 | EXPECT | |
43b5ab4c BF |
881 | ######## |
882 | # toke.c | |
0453d815 | 883 | open FOO || time; |
240d1b6f | 884 | open local *FOO; # should be ok |
0453d815 PM |
885 | EXPECT |
886 | Precedence problem: open FOO should be open(FOO) at - line 2. | |
887 | ######## | |
71aa9713 BF |
888 | # toke.c |
889 | use utf8; | |
890 | use open qw( :utf8 :std ); | |
891 | open FÒÒ || time; | |
892 | EXPECT | |
893 | Precedence problem: open FÒÒ should be open(FÒÒ) at - line 4. | |
894 | ######## | |
895 | # toke.c | |
896 | use utf8; | |
897 | use open qw( :utf8 :std ); | |
898 | open ᒍOO || time; | |
899 | EXPECT | |
900 | Precedence problem: open ᒍOO should be open(ᒍOO) at - line 4. | |
901 | ######## | |
66fbe8fb HS |
902 | # toke.c (and [perl #16184]) |
903 | open FOO => "<&0"; close FOO; | |
904 | EXPECT | |
905 | ######## | |
0453d815 PM |
906 | # toke.c |
907 | $^W = 0 ; | |
908 | open FOO || time; | |
909 | { | |
e476b1b5 | 910 | no warnings 'precedence' ; |
0453d815 | 911 | open FOO || time; |
e476b1b5 | 912 | use warnings 'precedence' ; |
0453d815 PM |
913 | open FOO || time; |
914 | } | |
915 | open FOO || time; | |
db3abe52 | 916 | open Foo::BAR; # this should not warn |
0453d815 PM |
917 | EXPECT |
918 | Precedence problem: open FOO should be open(FOO) at - line 3. | |
919 | Precedence problem: open FOO should be open(FOO) at - line 8. | |
920 | Precedence problem: open FOO should be open(FOO) at - line 10. | |
921 | ######## | |
922 | # toke.c | |
923 | $^W = 0 ; | |
71aa9713 BF |
924 | use utf8; |
925 | use open qw( :utf8 :std ); | |
926 | open FÒÒ || time; | |
927 | { | |
928 | no warnings 'precedence' ; | |
929 | open FÒÒ || time; | |
930 | use warnings 'precedence' ; | |
931 | open FÒÒ || time; | |
932 | } | |
933 | open FÒÒ || time; | |
934 | EXPECT | |
935 | Precedence problem: open FÒÒ should be open(FÒÒ) at - line 5. | |
936 | Precedence problem: open FÒÒ should be open(FÒÒ) at - line 10. | |
937 | Precedence problem: open FÒÒ should be open(FÒÒ) at - line 12. | |
938 | ######## | |
939 | # toke.c | |
940 | use utf8; | |
941 | use open qw( :utf8 :std ); | |
942 | $^W = 0 ; | |
943 | open ᒍÒÒ || time; | |
944 | { | |
945 | no warnings 'precedence' ; | |
946 | open ᒍÒÒ || time; | |
947 | use warnings 'precedence' ; | |
948 | open ᒍÒÒ || time; | |
949 | } | |
950 | open ᒍÒÒ || time; | |
951 | EXPECT | |
952 | Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 5. | |
953 | Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 10. | |
954 | Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 12. | |
955 | ######## | |
956 | # toke.c | |
957 | $^W = 0 ; | |
0453d815 PM |
958 | *foo *foo ; |
959 | { | |
4438c4b7 | 960 | no warnings 'ambiguous' ; |
0453d815 | 961 | *foo *foo ; |
4438c4b7 | 962 | use warnings 'ambiguous' ; |
0453d815 PM |
963 | *foo *foo ; |
964 | } | |
965 | *foo *foo ; | |
9700e2d3 FC |
966 | # These should not warn [perl #117535]: |
967 | foo**foo ; | |
968 | no warnings 'deprecated'; | |
969 | sort $*foo ; | |
970 | sort $ *foo ; | |
0453d815 PM |
971 | EXPECT |
972 | Operator or semicolon missing before *foo at - line 3. | |
973 | Ambiguous use of * resolved as operator * at - line 3. | |
974 | Operator or semicolon missing before *foo at - line 8. | |
975 | Ambiguous use of * resolved as operator * at - line 8. | |
976 | Operator or semicolon missing before *foo at - line 10. | |
977 | Ambiguous use of * resolved as operator * at - line 10. | |
767a6a26 PM |
978 | ######## |
979 | # toke.c | |
9700e2d3 FC |
980 | $^W = 0 ; |
981 | %foo %foo ; | |
982 | { | |
983 | no warnings 'ambiguous' ; | |
984 | %foo %foo ; | |
985 | use warnings 'ambiguous' ; | |
986 | %foo %foo ; | |
987 | } | |
988 | %foo %foo ; | |
989 | # This should not produce ambiguity warnings [perl #117535]: | |
990 | sort $%foo ; | |
991 | sort $ %foo ; | |
992 | EXPECT | |
993 | Operator or semicolon missing before %foo at - line 3. | |
994 | Ambiguous use of % resolved as operator % at - line 3. | |
995 | Operator or semicolon missing before %foo at - line 8. | |
996 | Ambiguous use of % resolved as operator % at - line 8. | |
997 | Operator or semicolon missing before %foo at - line 10. | |
998 | Ambiguous use of % resolved as operator % at - line 10. | |
999 | Bareword found where operator expected at - line 12, near "$%foo" | |
1000 | (Missing operator before foo?) | |
1001 | Bareword found where operator expected at - line 13, near "$ %foo" | |
1002 | (Missing operator before foo?) | |
1003 | Illegal modulus zero at - line 3. | |
1004 | ######## | |
1005 | # toke.c | |
1006 | $^W = 0 ; | |
1007 | &foo &foo ; | |
1008 | { | |
1009 | no warnings 'ambiguous' ; | |
1010 | &foo &foo ; | |
1011 | use warnings 'ambiguous' ; | |
1012 | &foo &foo ; | |
1013 | } | |
1014 | &foo &foo ; | |
1015 | # These should not warn produce ambiguity warnings [perl #76910]: | |
1016 | foo&&foo ; | |
1017 | sort $&foo ; | |
1018 | sort $ &foo ; | |
1019 | EXPECT | |
1020 | Operator or semicolon missing before &foo at - line 3. | |
1021 | Ambiguous use of & resolved as operator & at - line 3. | |
1022 | Operator or semicolon missing before &foo at - line 8. | |
1023 | Ambiguous use of & resolved as operator & at - line 8. | |
1024 | Operator or semicolon missing before &foo at - line 10. | |
1025 | Ambiguous use of & resolved as operator & at - line 10. | |
1026 | Bareword found where operator expected at - line 13, near "$&foo" | |
1027 | (Missing operator before foo?) | |
1028 | Bareword found where operator expected at - line 14, near "$ &foo" | |
1029 | (Missing operator before foo?) | |
1030 | Undefined subroutine &main::foo called at - line 3. | |
1031 | ######## | |
1032 | # toke.c | |
02571fe8 BF |
1033 | use utf8; |
1034 | use open qw( :utf8 :std ); | |
1035 | $^W = 0 ; | |
1036 | *foo *foo ; | |
1037 | { | |
1038 | no warnings 'ambiguous' ; | |
1039 | *foo *foo ; | |
1040 | use warnings 'ambiguous' ; | |
1041 | *foo *foo ; | |
1042 | } | |
1043 | *foo *foo ; | |
1044 | EXPECT | |
1045 | Operator or semicolon missing before *foo at - line 5. | |
1046 | Ambiguous use of * resolved as operator * at - line 5. | |
1047 | Operator or semicolon missing before *foo at - line 10. | |
1048 | Ambiguous use of * resolved as operator * at - line 10. | |
1049 | Operator or semicolon missing before *foo at - line 12. | |
1050 | Ambiguous use of * resolved as operator * at - line 12. | |
1051 | ######## | |
1052 | # toke.c | |
e476b1b5 | 1053 | use warnings 'misc' ; |
767a6a26 | 1054 | my $a = "\m" ; |
e476b1b5 | 1055 | no warnings 'misc' ; |
767a6a26 PM |
1056 | $a = "\m" ; |
1057 | EXPECT | |
1058 | Unrecognized escape \m passed through at - line 3. | |
1059 | ######## | |
1060 | # toke.c | |
52ed07f6 BF |
1061 | use warnings 'misc' ; |
1062 | my $a = "abcd\E" ; | |
1063 | no warnings 'misc' ; | |
1064 | $a = "abcd\E" ; | |
1065 | EXPECT | |
820438b1 | 1066 | Useless use of \E at - line 3. |
52ed07f6 BF |
1067 | ######## |
1068 | # toke.c | |
1c2511e0 | 1069 | use feature 'postderef_qq'; |
1f25714a FC |
1070 | (\$_)->$*; |
1071 | "$_->$*"; | |
1f25714a FC |
1072 | (\$_)->$*; |
1073 | "$_->$*"; | |
1074 | EXPECT | |
1f25714a FC |
1075 | ######## |
1076 | # toke.c | |
767a6a26 PM |
1077 | use warnings 'portable' ; |
1078 | my $a = 0b011111111111111111111111111111110 ; | |
1079 | $a = 0b011111111111111111111111111111111 ; | |
1080 | $a = 0b111111111111111111111111111111111 ; | |
1081 | $a = 0x0fffffffe ; | |
1082 | $a = 0x0ffffffff ; | |
1083 | $a = 0x1ffffffff ; | |
1084 | $a = 0037777777776 ; | |
1085 | $a = 0037777777777 ; | |
1086 | $a = 0047777777777 ; | |
1087 | no warnings 'portable' ; | |
1088 | $a = 0b011111111111111111111111111111110 ; | |
1089 | $a = 0b011111111111111111111111111111111 ; | |
1090 | $a = 0b111111111111111111111111111111111 ; | |
1091 | $a = 0x0fffffffe ; | |
1092 | $a = 0x0ffffffff ; | |
1093 | $a = 0x1ffffffff ; | |
1094 | $a = 0037777777776 ; | |
1095 | $a = 0037777777777 ; | |
1096 | $a = 0047777777777 ; | |
1097 | EXPECT | |
1098 | Binary number > 0b11111111111111111111111111111111 non-portable at - line 5. | |
1099 | Hexadecimal number > 0xffffffff non-portable at - line 8. | |
1100 | Octal number > 037777777777 non-portable at - line 11. | |
1101 | ######## | |
1102 | # toke.c | |
1103 | use warnings 'overflow' ; | |
1104 | my $a = 0b011111111111111111111111111111110 ; | |
1105 | $a = 0b011111111111111111111111111111111 ; | |
15041a67 | 1106 | $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ; |
767a6a26 PM |
1107 | $a = 0x0fffffffe ; |
1108 | $a = 0x0ffffffff ; | |
15041a67 | 1109 | $a = 0x10000000000000000 ; |
767a6a26 PM |
1110 | $a = 0037777777776 ; |
1111 | $a = 0037777777777 ; | |
15041a67 | 1112 | $a = 002000000000000000000000; |
767a6a26 PM |
1113 | no warnings 'overflow' ; |
1114 | $a = 0b011111111111111111111111111111110 ; | |
1115 | $a = 0b011111111111111111111111111111111 ; | |
15041a67 | 1116 | $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ; |
767a6a26 PM |
1117 | $a = 0x0fffffffe ; |
1118 | $a = 0x0ffffffff ; | |
15041a67 | 1119 | $a = 0x10000000000000000 ; |
767a6a26 PM |
1120 | $a = 0037777777776 ; |
1121 | $a = 0037777777777 ; | |
15041a67 | 1122 | $a = 002000000000000000000000; |
767a6a26 PM |
1123 | EXPECT |
1124 | Integer overflow in binary number at - line 5. | |
1125 | Integer overflow in hexadecimal number at - line 8. | |
1126 | Integer overflow in octal number at - line 11. | |
8593bda5 GS |
1127 | ######## |
1128 | # toke.c | |
ac206dc8 | 1129 | BEGIN { $^C = 1; } |
30b17cc1 A |
1130 | dump; |
1131 | CORE::dump; | |
1132 | EXPECT | |
1133 | dump() better written as CORE::dump(). dump() will no longer be available in Perl 5.30 at - line 3. | |
1134 | - syntax OK | |
1135 | ######## | |
1136 | # toke.c | |
1137 | BEGIN { $^C = 1; } | |
1138 | no warnings 'deprecated'; | |
1139 | dump; | |
1140 | CORE::dump; | |
1141 | EXPECT | |
1142 | - syntax OK | |
1143 | ######## | |
1144 | # toke.c | |
1145 | BEGIN { $^C = 1; } | |
1146 | no warnings 'deprecated'; | |
ac206dc8 RGS |
1147 | use warnings 'misc'; |
1148 | dump; | |
1149 | CORE::dump; | |
1150 | EXPECT | |
30b17cc1 | 1151 | dump() better written as CORE::dump(). dump() will no longer be available in Perl 5.30 at - line 5. |
ac206dc8 RGS |
1152 | - syntax OK |
1153 | ######## | |
1154 | # toke.c | |
1155 | use warnings 'misc'; | |
1156 | use subs qw/dump/; | |
93f09d7b | 1157 | sub dump { print "no warning for overridden dump\n"; } |
ac206dc8 RGS |
1158 | dump; |
1159 | EXPECT | |
93f09d7b | 1160 | no warning for overridden dump |
ac206dc8 RGS |
1161 | ######## |
1162 | # toke.c | |
8593bda5 GS |
1163 | use warnings 'ambiguous'; |
1164 | "@mjd_previously_unused_array"; | |
1165 | no warnings 'ambiguous'; | |
29fb1d0e | 1166 | "@mjd_previously_unused_array2"; |
8593bda5 GS |
1167 | EXPECT |
1168 | Possible unintended interpolation of @mjd_previously_unused_array in string at - line 3. | |
707afd92 MS |
1169 | ######## |
1170 | # toke.c | |
29fb1d0e BF |
1171 | use utf8; |
1172 | use open qw( :utf8 :std ); | |
1173 | use warnings 'ambiguous'; | |
1174 | "@mjd_previously_unused_àrray"; | |
1175 | no warnings 'ambiguous'; | |
1176 | "@mjd_previously_unused_àrray2"; | |
1177 | EXPECT | |
1178 | Possible unintended interpolation of @mjd_previously_unused_àrray in string at - line 5. | |
1179 | ######## | |
1180 | # toke.c | |
1181 | use utf8; | |
1182 | use open qw( :utf8 :std ); | |
1183 | use warnings 'ambiguous'; | |
1184 | "@mjd_previously_unused_ぁrrぁy"; | |
1185 | no warnings 'ambiguous'; | |
1186 | "@mjd_previously_unused_ぁrrぁy2"; | |
1187 | EXPECT | |
1188 | Possible unintended interpolation of @mjd_previously_unused_ぁrrぁy in string at - line 5. | |
1189 | ######## | |
10030f4b FC |
1190 | -w |
1191 | # toke.c | |
1192 | $_ = "@DB::args"; | |
1193 | EXPECT | |
1194 | ######## | |
29fb1d0e | 1195 | # toke.c |
d8c55666 | 1196 | # 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com |
4ac733c9 MJD |
1197 | use warnings 'regexp'; |
1198 | "foo" =~ /foo/c; | |
64e578a2 | 1199 | "foo" =~ /foo/cg; |
4ac733c9 MJD |
1200 | no warnings 'regexp'; |
1201 | "foo" =~ /foo/c; | |
64e578a2 | 1202 | "foo" =~ /foo/cg; |
4ac733c9 MJD |
1203 | EXPECT |
1204 | Use of /c modifier is meaningless without /g at - line 4. | |
1205 | ######## | |
1206 | # toke.c | |
d8c55666 | 1207 | # 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com |
4ac733c9 MJD |
1208 | use warnings 'regexp'; |
1209 | $_ = "ab" ; | |
1210 | s/ab/ab/c; | |
64e578a2 | 1211 | s/ab/ab/cg; |
4ac733c9 MJD |
1212 | no warnings 'regexp'; |
1213 | s/ab/ab/c; | |
64e578a2 | 1214 | s/ab/ab/cg; |
4ac733c9 | 1215 | EXPECT |
64e578a2 MJD |
1216 | Use of /c modifier is meaningless in s/// at - line 5. |
1217 | Use of /c modifier is meaningless in s/// at - line 6. | |
d8c55666 MJD |
1218 | ######## |
1219 | -wa | |
1220 | # toke.c | |
1221 | # 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings | |
1222 | print "@F\n"; | |
1223 | EXPECT | |
1224 | ||
1225 | ######## | |
1226 | -w | |
1227 | # toke.c | |
1228 | # 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings | |
1229 | print "@F\n"; | |
1230 | EXPECT | |
1231 | Possible unintended interpolation of @F in string at - line 4. | |
1232 | Name "main::F" used only once: possible typo at - line 4. | |
1233 | ######## | |
1234 | -wa | |
1235 | # toke.c | |
1236 | # 20020414 mjd-perl-patch+@plover.com | |
1237 | EXPECT | |
1238 | ||
2710853f MJD |
1239 | ######## |
1240 | # toke.c | |
1241 | # 20020414 mjd-perl-patch+@plover.com | |
1242 | # In 5.7.3, this emitted "Possible unintended interpolation" warnings | |
1243 | use warnings 'ambiguous'; | |
1244 | $s = "(@-)(@+)"; | |
1245 | EXPECT | |
1246 | ||
56da5a46 RGS |
1247 | ######## |
1248 | # toke.c | |
1249 | # mandatory warning | |
1250 | eval q/if ($a) { } elseif ($b) { }/; | |
1251 | no warnings "syntax"; | |
1252 | eval q/if ($a) { } elseif ($b) { }/; | |
1253 | EXPECT | |
1254 | elseif should be elsif at (eval 1) line 1. | |
1255 | ######## | |
1256 | # toke.c | |
1257 | # mandatory warning | |
1258 | eval q/5 6/; | |
1259 | no warnings "syntax"; | |
1260 | eval q/5 6/; | |
1261 | EXPECT | |
1262 | Number found where operator expected at (eval 1) line 1, near "5 6" | |
1263 | (Missing operator before 6?) | |
984200d0 YST |
1264 | ######## |
1265 | # toke.c | |
7fc874e8 | 1266 | use warnings "syntax"; no warnings "deprecated"; |
984200d0 YST |
1267 | $_ = $a = 1; |
1268 | $a !=~ /1/; | |
1269 | $a !=~ m#1#; | |
1270 | $a !=~/1/; | |
decca21c YST |
1271 | $a !=~ y/1//; |
1272 | $a !=~ tr/1//; | |
1273 | $a !=~ s/1//; | |
984200d0 YST |
1274 | $a != ~/1/; |
1275 | no warnings "syntax"; | |
1276 | $a !=~ /1/; | |
1277 | $a !=~ m#1#; | |
1278 | $a !=~/1/; | |
decca21c YST |
1279 | $a !=~ y/1//; |
1280 | $a !=~ tr/1//; | |
1281 | $a !=~ s/1//; | |
984200d0 YST |
1282 | EXPECT |
1283 | !=~ should be !~ at - line 4. | |
1284 | !=~ should be !~ at - line 5. | |
1285 | !=~ should be !~ at - line 6. | |
1286 | !=~ should be !~ at - line 7. | |
decca21c YST |
1287 | !=~ should be !~ at - line 8. |
1288 | !=~ should be !~ at - line 9. | |
1108974d RGS |
1289 | ######## |
1290 | # toke.c | |
60e04ba1 | 1291 | use warnings "syntax"; |
9e8d7757 RB |
1292 | sub proto_after_array(@$); |
1293 | sub proto_after_arref(\@$); | |
1294 | sub proto_after_arref2(\[@$]); | |
1295 | sub proto_after_arref3(\[@$]_); | |
1296 | sub proto_after_hash(%$); | |
1297 | sub proto_after_hashref(\%$); | |
1298 | sub proto_after_hashref2(\[%$]); | |
1299 | sub underscore_last_pos($_); | |
1300 | sub underscore2($_;$); | |
1301 | sub underscore_fail($_$); | |
1302 | sub underscore_after_at(@_); | |
689aac7b FC |
1303 | our sub hour (@$); |
1304 | my sub migh (@$); | |
e7d0b801 | 1305 | use feature 'state'; |
689aac7b FC |
1306 | state sub estate (@$); |
1307 | package other; | |
1308 | sub hour (@$); | |
1309 | sub migh (@$); | |
1310 | sub estate (@$); | |
9e8d7757 RB |
1311 | no warnings "syntax"; |
1312 | sub proto_after_array(@$); | |
1313 | sub proto_after_hash(%$); | |
1314 | sub underscore_fail($_$); | |
1315 | EXPECT | |
1316 | Prototype after '@' for main::proto_after_array : @$ at - line 3. | |
1317 | Prototype after '%' for main::proto_after_hash : %$ at - line 7. | |
aef2a98a | 1318 | Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12. |
9e8d7757 | 1319 | Prototype after '@' for main::underscore_after_at : @_ at - line 13. |
689aac7b FC |
1320 | Prototype after '@' for hour : @$ at - line 14. |
1321 | Prototype after '@' for migh : @$ at - line 15. | |
1322 | Prototype after '@' for estate : @$ at - line 17. | |
1323 | Prototype after '@' for hour : @$ at - line 19. | |
1324 | Prototype after '@' for migh : @$ at - line 20. | |
1325 | Prototype after '@' for estate : @$ at - line 21. | |
77772344 B |
1326 | ######## |
1327 | # toke.c | |
1328 | use warnings "ambiguous"; | |
1329 | "foo\nn" =~ /^foo$\n/; | |
1330 | "foo\nn" =~ /^foo${\}n/; | |
1331 | my $foo = qr/^foo$\n/; | |
1332 | my $bar = qr/^foo${\}n/; | |
1333 | no warnings "ambiguous"; | |
1334 | "foo\nn" =~ /^foo$\n/; | |
1335 | "foo\nn" =~ /^foo${\}n/; | |
1336 | my $foo = qr/^foo$\n/; | |
1337 | my $bar = qr/^foo${\}n/; | |
1338 | EXPECT | |
1339 | Possible unintended interpolation of $\ in regex at - line 3. | |
1340 | Possible unintended interpolation of $\ in regex at - line 5. | |
d83f38d8 NC |
1341 | ######## |
1342 | # toke.c | |
f0a2b745 KW |
1343 | use warnings 'syntax' ; |
1344 | my $a = "\o"; | |
1345 | my $a = "\o{"; | |
1346 | my $a = "\o{}"; | |
1347 | no warnings 'syntax' ; | |
1348 | my $a = "\o"; | |
1349 | my $a = "\o{"; | |
1350 | my $a = "\o{}"; | |
1351 | EXPECT | |
1352 | Missing braces on \o{} at - line 3, within string | |
1353 | Missing right brace on \o{ at - line 4, within string | |
1354 | Number with no digits at - line 5, within string | |
1355 | BEGIN not safe after errors--compilation aborted at - line 6. | |
1356 | ######## | |
1357 | # toke.c | |
1358 | use warnings 'digit' ; | |
1359 | my $a = "\o{1238456}"; | |
1360 | no warnings 'digit' ; | |
1361 | my $a = "\o{1238456}"; | |
1362 | EXPECT | |
1363 | Non-octal character '8'. Resolved as "\o{123}" at - line 3. | |
725a61d7 Z |
1364 | ######## |
1365 | # toke.c | |
1366 | use warnings; | |
c3383756 | 1367 | print ref ? "yes\n" : "no\n" foreach [], ''; # ? is unambiguosly an operator |
725a61d7 | 1368 | EXPECT |
725a61d7 Z |
1369 | yes |
1370 | no | |
c3383756 DIM |
1371 | ######## |
1372 | # toke .c | |
1373 | use warnings; | |
1374 | $a =~ ?rand?; # ? is not a regex match | |
1375 | EXPECT | |
1376 | syntax error at - line 3, near "=~ ?" | |
1377 | Execution of - aborted due to compilation errors. | |
17a3df4c KW |
1378 | ######## |
1379 | # toke.c | |
46b78aa8 KW |
1380 | BEGIN { |
1381 | if (ord('A') == 193) { | |
1382 | print "SKIPPED\n# result varies depending on which ebcdic platform"; | |
1383 | exit 0; | |
1384 | } | |
1385 | } | |
17a3df4c | 1386 | use warnings; |
17a3df4c KW |
1387 | $a = "\c,"; |
1388 | $a = "\c`"; | |
d4360efa | 1389 | no warnings 'syntax'; |
17a3df4c KW |
1390 | $a = "\c,"; |
1391 | $a = "\c`"; | |
17a3df4c | 1392 | EXPECT |
d4360efa S |
1393 | "\c," is more clearly written simply as "l" at - line 9. |
1394 | "\c`" is more clearly written simply as "\ " at - line 10. | |
421e43ba KW |
1395 | ######## |
1396 | # toke.c | |
a27ed980 KW |
1397 | BEGIN { |
1398 | if (ord('A') == 193) { | |
1399 | print "SKIPPED\n# test is ASCII-specific"; | |
1400 | exit 0; | |
1401 | } | |
1402 | } | |
1403 | use warnings; | |
1404 | my $a = "\c{ack}"; | |
1405 | EXPECT | |
1406 | OPTION fatal | |
1407 | Use ";" instead of "\c{" at - line 9. | |
1408 | ######## | |
1409 | # toke.c | |
1410 | BEGIN { | |
1411 | if (ord('A') == 65) { | |
1412 | print "SKIPPED\n# test is EBCDIC-specific"; | |
1413 | exit 0; | |
1414 | } | |
1415 | } | |
421e43ba KW |
1416 | use warnings; |
1417 | my $a = "\c{ack}"; | |
1418 | EXPECT | |
1419 | OPTION fatal | |
a27ed980 | 1420 | Sequence "\c{" invalid at - line 9. |
3955e1a9 KW |
1421 | ######## |
1422 | # toke.c | |
9b8f4e92 KW |
1423 | my $a = "\câ"; |
1424 | EXPECT | |
1425 | OPTION fatal | |
1426 | Character following "\c" must be printable ASCII at - line 2. | |
1427 | ######## | |
1428 | # toke.c | |
3955e1a9 KW |
1429 | use warnings 'syntax' ; |
1430 | my $a = qr/foo/du; | |
ff3f26d2 | 1431 | $a = qr/foo/lai; |
3955e1a9 | 1432 | $a = qr/foo/lil; |
ff3f26d2 KW |
1433 | $a = qr/foo/aia; |
1434 | $a = qr/foo/aaia; | |
3955e1a9 KW |
1435 | no warnings 'syntax' ; |
1436 | my $a = qr/foo/du; | |
1437 | EXPECT | |
1438 | Regexp modifiers "/d" and "/u" are mutually exclusive at - line 3, near "= " | |
1439 | Regexp modifiers "/l" and "/a" are mutually exclusive at - line 4, near "= " | |
1440 | Regexp modifier "/l" may not appear twice at - line 5, near "= " | |
ff3f26d2 KW |
1441 | Regexp modifier "/a" may appear a maximum of twice at - line 7, near "= " |
1442 | BEGIN not safe after errors--compilation aborted at - line 8. | |
ba05d9aa FC |
1443 | ######## |
1444 | # toke.c | |
1445 | # [perl #4362] | |
1446 | eval "print q\xabfoo"; | |
1447 | print "ok\n" if | |
1448 | $@ =~ /Can't find string terminator "\xab" anywhere before EOF/; | |
1449 | EXPECT | |
1450 | ok | |
5c66c3dd BF |
1451 | ######## |
1452 | # toke.c | |
1453 | use utf8; | |
1454 | use open qw( :utf8 :std ); | |
1455 | use warnings 'ambiguous' ; | |
1456 | sub frèd {} | |
1457 | $a = ${frèd} ; | |
1458 | no warnings 'ambiguous' ; | |
1459 | $a = ${frèd} ; | |
1460 | EXPECT | |
1461 | Ambiguous use of ${frèd} resolved to $frèd at - line 6. | |
1462 | ######## | |
1463 | # toke.c | |
1464 | use utf8; | |
1465 | use open qw( :utf8 :std ); | |
1466 | use warnings 'ambiguous' ; | |
1467 | sub f렏 {} | |
1468 | $a = ${f렏} ; | |
1469 | no warnings 'ambiguous' ; | |
1470 | $a = ${f렏} ; | |
1471 | EXPECT | |
1472 | Ambiguous use of ${f렏} resolved to $f렏 at - line 6. | |
3773592b BF |
1473 | ######## |
1474 | # toke.c | |
1475 | use utf8; | |
1476 | use open qw( :utf8 :std ); | |
1477 | use warnings; | |
1478 | CORE::렏; | |
1479 | EXPECT | |
1480 | CORE::렏 is not a keyword at - line 5. | |
5dc13276 MH |
1481 | ######## |
1482 | # toke.c | |
1483 | # [perl #16249] | |
1484 | print ''; | |
1485 | eval this_method_is_fake (); | |
1486 | EXPECT | |
1487 | Undefined subroutine &main::this_method_is_fake called at - line 4. | |
a71a1afb FC |
1488 | ######## |
1489 | # toke.c | |
1490 | # [perl #107002] Erroneous ambiguity warnings | |
1491 | sub { # do not actually call require | |
1492 | require a::b . 1; # These used to produce erroneous | |
1493 | require a::b + 1; # ambiguity warnings. | |
1494 | } | |
1495 | EXPECT | |
4d68ffa0 KW |
1496 | ######## |
1497 | # toke.c | |
412f55bb KW |
1498 | # [perl #113094], [perl #119101], since reverted so no warnings generated |
1499 | use warnings; | |
003a6439 CB |
1500 | print "aa" =~ m{^a\{1,2\}$}, "A\n"; |
1501 | print "aa" =~ m{^a\x\{61\}$}, "B\n"; | |
1502 | print "a\\x{6F}" =~ m{^a\\x\{6F\}$}, "C\n"; | |
1503 | print "a\\o" =~ m{^a\\\x\{6F\}$}, "D\n"; | |
1504 | print "a\\\\x{6F}" =~ m{^a\\\\x\{6F\}$}, "E\n"; | |
1505 | print "a\\\\o" =~ m{^a\\\\\x\{6F\}$}, "F\n"; | |
1506 | print "aa" =~ m{^a{1,2}$}, "G\n"; | |
1507 | print "aq" =~ m[^a\[a-z\]$], "H\n"; | |
1508 | print "aq" =~ m(^a\(q\)$), "I\n"; | |
4d68ffa0 | 1509 | EXPECT |
412f55bb | 1510 | Illegal hexadecimal digit '\' ignored at - line 5. |
412f55bb KW |
1511 | Illegal hexadecimal digit '\' ignored at - line 7. |
1512 | Illegal hexadecimal digit '\' ignored at - line 9. | |
003a6439 CB |
1513 | A |
1514 | B | |
1515 | 1C | |
1516 | D | |
1517 | 1E | |
1518 | F | |
1519 | 1G | |
1520 | H | |
1521 | I | |
b29f65fc BF |
1522 | ######## |
1523 | # toke.c | |
1524 | #[perl #119123] disallow literal control character variables | |
b29f65fc BF |
1525 | *{ |
1526 | Foo | |
1527 | }; # shouldn't warn on {\n, even though \n is a control character | |
1528 | EXPECT | |
46879fad DM |
1529 | ######## |
1530 | # toke.c | |
1531 | # [perl #120288] -X at start of line gave spurious warning, where X is not | |
1532 | # a filetest operator | |
1533 | -a; | |
1534 | ;-a; | |
1535 | EXPECT | |
b3089e96 AV |
1536 | ######## |
1537 | # toke.c | |
1538 | # [perl #124113] Compile-time warning with UTF8 variable in array index | |
1539 | use warnings; | |
1540 | use utf8; | |
1541 | my $𝛃 = 0; | |
1542 | my @array = (0); | |
1543 | my $v = $array[ 0 + $𝛃 ]; | |
1544 | $v = $array[ $𝛃 + 0 ]; | |
1545 | EXPECT | |
6e59c862 AV |
1546 | ######## |
1547 | # toke.c | |
1548 | # Allow Unicode here doc boundaries | |
1549 | use warnings; | |
1550 | use utf8; | |
1551 | my $v = <<EnFraçais; | |
1552 | Comme ca! | |
1553 | EnFraçais | |
1554 | print $v; | |
1555 | EXPECT | |
1556 | Comme ca! | |
8ce2ba82 AV |
1557 | ######## |
1558 | # toke.c | |
1559 | # Fix 'Use of "..." without parentheses is ambiguous' warning for | |
b59c097b AV |
1560 | # Unicode function names. If not under PERL_UNICODE, this will generate |
1561 | # a "Wide character" warning | |
8ce2ba82 AV |
1562 | use utf8; |
1563 | use warnings; | |
1564 | sub 𝛃(;$) { return 0; } | |
1565 | my $v = 𝛃 - 5; | |
1566 | EXPECT | |
b59c097b AV |
1567 | OPTION regex |
1568 | (Wide character.*\n)?Warning: Use of "𝛃" without parentheses is ambiguous | |
554b0b9d DC |
1569 | ######## |
1570 | # RT #4346 Case 1: Warnings for print (...) | |
1571 | # TODO RT #4346: Warnings for print(...) are inconsistent | |
1572 | use warnings; | |
1573 | print ("((\n"); | |
1574 | print (">>\n"); | |
1575 | EXPECT | |
1576 | print (...) interpreted as function at - line 3. | |
1577 | print (...) interpreted as function at - line 4. | |
1578 | (( | |
1579 | >> | |
1580 | ######## | |
1581 | # RT #4346 Case 2: Warnings for print (...) | |
1582 | use warnings; | |
1583 | print ("((\n"); | |
1584 | print (">>\n") | |
1585 | EXPECT | |
1586 | print (...) interpreted as function at - line 3. | |
1587 | print (...) interpreted as function at - line 4. | |
1588 | (( | |
1589 | >> | |
1590 | ######## | |
1591 | # RT #4346 Case 3: Warnings for print (...) | |
1592 | # TODO RT #4346: Warnings for print(...) are inconsistent | |
1593 | use warnings; | |
1594 | print (">>\n"); | |
1595 | print ("((\n"); | |
1596 | EXPECT | |
1597 | print (...) interpreted as function at - line 3. | |
1598 | print (...) interpreted as function at - line 4. | |
1599 | >> | |
1600 | (( | |
1601 | ######## | |
1602 | # RT #4346 Case 4: Warnings for print (...) | |
1603 | # TODO RT #4346: Warnings for print(...) are inconsistent | |
1604 | use warnings; | |
1605 | print (")\n"); | |
1606 | print ("))\n"); | |
1607 | EXPECT | |
1608 | print (...) interpreted as function at - line 3. | |
1609 | print (...) interpreted as function at - line 4. | |
1610 | ) | |
1611 | )) | |
94749a5e KW |
1612 | ######## |
1613 | # NAME Non-grapheme delimiters | |
1614 | BEGIN{ | |
1615 | if (ord('A') == 193) { | |
1616 | print "SKIPPED\n# ebcdic platforms generates different Malformed UTF-8 warnings."; | |
1617 | exit 0; | |
1618 | } | |
1619 | } | |
1620 | use utf8; | |
1621 | my $a = qr ̂foobar̂; | |
1622 | EXPECT | |
7cb258c1 | 1623 | Use of unassigned code point or non-standalone grapheme for a delimiter will be a fatal error starting in Perl 5.30 at - line 8. |
21921336 | 1624 | ######## |
720a74f8 | 1625 | # NAME [perl #130567] Assertion failure |
21921336 KW |
1626 | BEGIN { |
1627 | if (ord('A') != 65) { | |
1628 | print "SKIPPED\n# test is ASCII-specific"; | |
1629 | exit 0; | |
1630 | } | |
1631 | } | |
1632 | no warnings "uninitialized"; | |
1633 | $_= ""; | |
1634 | s//\3000/; | |
1635 | s//"\x{180};;s\221(*$@$`\241\275";/gee; | |
1636 | s//"s\221\302\302\302\302\302\302\302$@\241\275";/gee; | |
1637 | EXPECT | |
d2067945 | 1638 | ######## |
720a74f8 | 1639 | # NAME [perl #130666] Assertion failure |
d2067945 KW |
1640 | no warnings "uninitialized"; |
1641 | BEGIN{$^H=-1};my $l; s\0$0[$l]\0\0 | |
1642 | EXPECT | |
00c7fba7 | 1643 | ######## |
720a74f8 | 1644 | # NAME [perl #129036] Assertion failure |
00c7fba7 KW |
1645 | BEGIN{$0="";$^H=hex join""=>A00000}p? |
1646 | EXPECT | |
1647 | OPTION fatal | |
1648 | syntax error at - line 1, at EOF | |
1649 | Execution of - aborted due to compilation errors. | |
6b9660ca KW |
1650 | ######## |
1651 | # NAME [perl #130655] | |
1652 | use utf8; | |
1653 | qw∘foo ∞ ♥ bar∘ | |
1654 | EXPECT |