This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Unbreak -bareword under strict+integer
[perl5.git] / t / lib / warnings / toke
1 toke.c  AOK
2
3     we seem to have lost a few ambiguous warnings!!
4
5  
6                 $a = <<;
7                 Use of comma-less variable list is deprecated 
8                 (called 3 times via depcom)
9
10      \1 better written as $1 
11         use warnings 'syntax' ;
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      Can't use \\%c to mean $%c in expression 
39         $_ = "ab" ; s/(ab)/\1/e;
40
41      Unquoted string "abc" may clash with future reserved word at - line 3.
42      warn(warn_reserved 
43         $a = abc;
44
45      Possible attempt to separate words with commas 
46         @a = qw(a, b, c) ;
47
48      Possible attempt to put comments in qw() list 
49         @a = qw(a b # c) ;
50
51      %s (...) interpreted as function 
52         print ("")
53         printf ("")
54         sort ("")
55
56      Ambiguous use of %c{%s%s} resolved to %c%s%s 
57         $a = ${time[2]}
58         $a = ${time{2}}
59
60
61      Ambiguous use of %c{%s} resolved to %c%s
62         $a = ${time}
63         sub fred {} $a = ${fred}
64
65      Misplaced _ in number 
66         $a = 1_2;
67         $a = 1_2345_6;
68
69     Bareword \"%s\" refers to nonexistent package
70         $a = FRED:: ;
71
72     Ambiguous call resolved as CORE::%s(), qualify as such or use &
73         sub time {} 
74         my $a = time()
75
76     Unrecognized escape \\%c passed through
77         $a = "\m" ;
78
79     Useless use of \\E.
80         $a = "abcd\E" ;
81
82     Postfix dereference is experimental
83
84     %s number > %s non-portable
85         my $a =  0b011111111111111111111111111111110 ;
86         $a =  0b011111111111111111111111111111111 ;
87         $a =  0b111111111111111111111111111111111 ;
88         $a =  0x0fffffffe ;
89         $a =  0x0ffffffff ;
90         $a =  0x1ffffffff ;
91         $a =  0037777777776 ;
92         $a =  0037777777777 ;
93         $a =  0047777777777 ;
94
95     Integer overflow in binary number
96         my $a =  0b011111111111111111111111111111110 ;
97         $a =  0b011111111111111111111111111111111 ;
98         $a =  0b111111111111111111111111111111111 ;
99         $a =  0x0fffffffe ;
100         $a =  0x0ffffffff ;
101         $a =  0x1ffffffff ;
102         $a =  0037777777776 ;
103         $a =  0037777777777 ;
104         $a =  0047777777777 ;
105
106     dump() better written as CORE::dump()
107
108     Use of /c modifier is meaningless without /g     
109
110     Use of /c modifier is meaningless in s///
111
112     Mandatory Warnings
113     ------------------
114     Use of "%s" without parentheses is ambiguous        [check_uni]
115         rand + 4 
116
117     Ambiguous use of -%s resolved as -&%s()             [yylex]
118         sub fred {} ; - fred ;
119
120     Precedence problem: open %.*s should be open(%.*s)  [yylex]
121         open FOO || die;
122
123     Operator or semicolon missing before %c%s           [yylex]
124     Ambiguous use of %c resolved as operator %c
125         *foo *foo
126
127 __END__
128 # toke.c 
129 format STDOUT =
130 @<<<  @|||  @>>>  @>>>
131 $a    $b    "abc" 'def'
132 .
133 no warnings 'deprecated' ;
134 format STDOUT =
135 @<<<  @|||  @>>>  @>>>
136 $a    $b    "abc" 'def'
137 .
138 EXPECT
139 Use of comma-less variable list is deprecated at - line 4.
140 Use of comma-less variable list is deprecated at - line 4.
141 Use of comma-less variable list is deprecated at - line 4.
142 ########
143 # toke.c
144 $a = <<;
145
146 no warnings 'deprecated' ;
147 $a = <<;
148
149 EXPECT
150 Use of bare << to mean <<"" is deprecated at - line 2.
151 ########
152 # toke.c
153 eval "\$\cT";
154 eval "\${\7LOBAL_PHASE}";
155 eval "\${\cT}";
156 eval "\${\n\cT}";
157 eval "\${\cT\n}";
158 my $ret = eval "\${\n\cT\n}";
159 print "ok\n" if $ret == $^T;
160
161 no warnings 'deprecated' ;
162 eval "\$\cT";
163 eval "\${\7LOBAL_PHASE}";
164 eval "\${\cT}";
165 eval "\${\n\cT}";
166 eval "\${\cT\n}";
167 eval "\${\n\cT\n}";
168
169 EXPECT
170 Use of literal control characters in variable names is deprecated at (eval 1) line 1.
171 Use of literal control characters in variable names is deprecated at (eval 2) line 1.
172 Use of literal control characters in variable names is deprecated at (eval 3) line 1.
173 Use of literal control characters in variable names is deprecated at (eval 4) line 2.
174 Use of literal control characters in variable names is deprecated at (eval 5) line 1.
175 Use of literal control characters in variable names is deprecated at (eval 6) line 2.
176 ok
177 ########
178 # toke.c
179 $a =~ m/$foo/eq;
180 $a =~ s/$foo/fool/seq;
181
182 EXPECT
183 OPTION fatal
184 Unknown regexp modifier "/e" at - line 2, near "=~ "
185 Unknown regexp modifier "/q" at - line 2, near "=~ "
186 Unknown regexp modifier "/q" at - line 3, near "=~ "
187 Execution of - aborted due to compilation errors.
188 ########
189 # toke.c
190 use utf8;
191 use open qw( :utf8 :std );
192 $a =~ m/$foo/eネq;
193 $a =~ s/$foo/fool/seネq;
194
195 EXPECT
196 OPTION fatal
197 Unknown regexp modifier "/e" at - line 4, near "=~ "
198 Unknown regexp modifier "/ネ" at - line 4, near "=~ "
199 Unknown regexp modifier "/q" at - line 4, near "=~ "
200 Unknown regexp modifier "/ネ" at - line 5, near "=~ "
201 Unknown regexp modifier "/q" at - line 5, near "=~ "
202 Execution of - aborted due to compilation errors.
203 ########
204 # toke.c
205 use warnings 'syntax' ;
206 s/(abc)/\1/;
207 no warnings 'syntax' ;
208 s/(abc)/\1/;
209 EXPECT
210 \1 better written as $1 at - line 3.
211 ########
212 # toke.c
213 use warnings 'semicolon' ;
214 $a = 1
215 &time ;
216 no warnings 'semicolon' ;
217 $a = 1
218 &time ;
219 EXPECT
220 Semicolon seems to be missing at - line 3.
221 ########
222 # toke.c
223 use warnings 'syntax' ;
224 my $a =+ 2 ;
225 $a =- 2 ;
226 $a =* 2 ;
227 $a =% 2 ;
228 $a =& 2 ;
229 $a =. 2 ;
230 $a =^ 2 ;
231 $a =| 2 ;
232 $a =< 2 ;
233 $a =/ 2 ;
234 EXPECT
235 Reversed += operator at - line 3.
236 Reversed -= operator at - line 4.
237 Reversed *= operator at - line 5.
238 Reversed %= operator at - line 6.
239 Reversed &= operator at - line 7.
240 Reversed .= operator at - line 8.
241 Reversed ^= operator at - line 9.
242 Reversed |= operator at - line 10.
243 Reversed <= operator at - line 11.
244 syntax error at - line 8, near "=."
245 syntax error at - line 9, near "=^"
246 syntax error at - line 10, near "=|"
247 Unterminated <> operator at - line 11.
248 ########
249 # toke.c
250 no warnings 'syntax' ;
251 my $a =+ 2 ;
252 $a =- 2 ;
253 $a =* 2 ;
254 $a =% 2 ;
255 $a =& 2 ;
256 $a =. 2 ;
257 $a =^ 2 ;
258 $a =| 2 ;
259 $a =< 2 ;
260 $a =/ 2 ;
261 EXPECT
262 syntax error at - line 8, near "=."
263 syntax error at - line 9, near "=^"
264 syntax error at - line 10, near "=|"
265 Unterminated <> operator at - line 11.
266 ########
267 # toke.c
268 use warnings 'syntax' ;
269 my $a = $a[1,2] ;
270 no warnings 'syntax' ;
271 my $a = $a[1,2] ;
272 EXPECT
273 Multidimensional syntax $a[1,2] not supported at - line 3.
274 ########
275 # toke.c
276 use warnings 'syntax' ;
277 sub fred {} ; $SIG{TERM} = fred;
278 no warnings 'syntax' ;
279 $SIG{TERM} = fred;
280 EXPECT
281 You need to quote "fred" at - line 3.
282 ########
283 # toke.c
284 use utf8;
285 use open qw( :utf8 :std );
286 use warnings 'syntax' ;
287 sub frèd {} ; $SIG{TERM} = frèd;
288 no warnings 'syntax' ;
289 $SIG{TERM} = frèd;
290 EXPECT
291 You need to quote "frèd" at - line 5.
292 ########
293 # toke.c
294 use utf8;
295 use open qw( :utf8 :std );
296 use warnings 'syntax' ;
297 sub ふれど {} ; $SIG{TERM} = ふれど;
298 no warnings 'syntax' ;
299 $SIG{TERM} = ふれど;
300 EXPECT
301 You need to quote "ふれど" at - line 5.
302 ########
303 # toke.c
304 use warnings 'syntax' ;
305 $_ = "ab" ; 
306 s/(ab)/\1/e;
307 no warnings 'syntax' ;
308 $_ = "ab" ; 
309 s/(ab)/\1/e;
310 EXPECT
311 Can't use \1 to mean $1 in expression at - line 4.
312 ########
313 # toke.c
314 use warnings 'reserved' ;
315 $a = abc;
316 $a = { def
317
318 => 1 };
319 no warnings 'reserved' ;
320 $a = abc;
321 EXPECT
322 Unquoted string "abc" may clash with future reserved word at - line 3.
323 ########
324 # toke.c
325 use warnings 'qw' ;
326 @a = qw(a, b, c) ;
327 no warnings 'qw' ;
328 @a = qw(a, b, c) ;
329 EXPECT
330 Possible attempt to separate words with commas at - line 3.
331 ########
332 # toke.c
333 use warnings 'qw' ;
334 @a = qw(a b c # #) ;
335 no warnings 'qw' ;
336 @a = qw(a b c # #) ;
337 EXPECT
338 Possible attempt to put comments in qw() list at - line 3.
339 ########
340 # toke.c
341 use warnings 'qw' ;
342 @a = qw(a, b, c # #) ;
343 no warnings 'qw' ;
344 @a = qw(a, b, c # #) ;
345 EXPECT
346 Possible attempt to separate words with commas at - line 3.
347 Possible attempt to put comments in qw() list at - line 3.
348 ########
349 # toke.c
350 use warnings 'syntax' ;
351 print ("");
352 print ("") and $x = 1;
353 print ("") or die;
354 print ("") // die;
355 print (1+2) * 3 if 0; # only this one should warn
356 print (1+2) if 0;
357 EXPECT
358 print (...) interpreted as function at - line 7.
359 ########
360 # toke.c
361 no warnings 'syntax' ;
362 print ("")
363 EXPECT
364
365 ########
366 # toke.c
367 use warnings 'syntax' ;
368 printf ("");
369 printf ("") . '';
370 EXPECT
371 printf (...) interpreted as function at - line 4.
372 ########
373 # toke.c
374 no warnings 'syntax' ;
375 printf ("")
376 EXPECT
377
378 ########
379 # toke.c
380 use warnings 'syntax' ;
381 sort ("");
382 sort ("") . '';
383 EXPECT
384 sort (...) interpreted as function at - line 4.
385 ########
386 # toke.c
387 no warnings 'syntax' ;
388 sort ("")
389 EXPECT
390
391 ########
392 # toke.c
393 use warnings 'ambiguous' ;
394 $a = ${time[2]};
395 no warnings 'ambiguous' ;
396 $a = ${time[2]};
397 EXPECT
398 Ambiguous use of ${time[...]} resolved to $time[...] at - line 3.
399 ########
400 # toke.c
401 use warnings 'ambiguous' ;
402 $a = ${time{2}};
403 EXPECT
404 Ambiguous use of ${time{...}} resolved to $time{...} at - line 3.
405 ########
406 # toke.c
407 use warnings 'ambiguous' ;
408 $a = ${
409
410     time
411         {2}
412 };
413 warn "after";
414 EXPECT
415 Ambiguous use of ${time{...}} resolved to $time{...} at - line 5.
416 after at - line 8.
417 ########
418 # toke.c
419 use warnings 'ambiguous' ;
420 $a = ${
421
422 time[2]
423
424 };
425 $a = ${
426
427 time    
428    [2]
429
430 };
431 warn "after";
432 EXPECT
433 Ambiguous use of ${time[...]} resolved to $time[...] at - line 5.
434 Ambiguous use of ${time[...]} resolved to $time[...] at - line 10.
435 after at - line 14.
436 ########
437 # toke.c
438 no warnings 'ambiguous' ;
439 $a = ${time{2}};
440 EXPECT
441
442 ########
443 # toke.c
444 use warnings 'ambiguous' ;
445 $a = ${time} ;
446 $a = @{time} ;
447 $a = $#{time} ; # This one is special cased in toke.c
448 $a = %{time} ;
449 $a = *{time} ;
450 $a = defined &{time} ; # To avoid calling &::time
451 no warnings 'ambiguous' ;
452 $a = ${time} ;
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
458 EXPECT
459 Ambiguous use of ${time} resolved to $time at - line 3.
460 Ambiguous use of @{time} resolved to @time at - line 4.
461 Ambiguous use of @{time} resolved to @time at - line 5.
462 Ambiguous use of %{time} resolved to %time at - line 6.
463 Ambiguous use of *{time} resolved to *time at - line 7.
464 Ambiguous use of &{time} resolved to &time at - line 8.
465 ########
466 # toke.c
467 use warnings 'ambiguous' ;
468 $a = ${
469 time
470 } ;
471 $a = @{
472 time
473 } ;
474 $a = $#{
475 time
476 } ;
477 $a = %{
478 time
479 } ;
480 $a = *{
481 time
482 } ;
483 $a = defined &{
484 time
485
486
487 } ;
488 warn "last";
489 EXPECT
490 Ambiguous use of ${time} resolved to $time at - line 4.
491 Ambiguous use of @{time} resolved to @time at - line 7.
492 Ambiguous use of @{time} resolved to @time at - line 10.
493 Ambiguous use of %{time} resolved to %time at - line 13.
494 Ambiguous use of *{time} resolved to *time at - line 16.
495 Ambiguous use of &{time} resolved to &time at - line 19.
496 last at - line 23.
497 ########
498 # toke.c
499 use warnings 'ambiguous' ;
500 sub fred {}
501 $a = ${fred} ;
502 no warnings 'ambiguous' ;
503 $a = ${fred} ;
504 EXPECT
505 Ambiguous use of ${fred} resolved to $fred at - line 4.
506 ########
507 # toke.c
508 use warnings 'syntax' ;
509 $a = _123; print "$a\n";                #( 3    string)
510 $a = 1_23; print "$a\n";
511 $a = 12_3; print "$a\n";
512 $a = 123_; print "$a\n";                #  6
513 $a = _+123; print "$a\n";               #  7    string)
514 $a = +_123; print "$a\n";               #( 8    string)
515 $a = +1_23; print "$a\n";
516 $a = +12_3; print "$a\n";
517 $a = +123_; print "$a\n";               # 11
518 $a = _-123; print "$a\n";               #(12    string)
519 $a = -_123; print "$a\n";               #(13    string)
520 $a = -1_23; print "$a\n";
521 $a = -12_3; print "$a\n";
522 $a = -123_; print "$a\n";               # 16
523 $a = 123._456; print "$a\n";            # 17
524 $a = 123.4_56; print "$a\n";
525 $a = 123.45_6; print "$a\n";
526 $a = 123.456_; print "$a\n";            # 20
527 $a = +123._456; print "$a\n";           # 21
528 $a = +123.4_56; print "$a\n";   
529 $a = +123.45_6; print "$a\n";   
530 $a = +123.456_; print "$a\n";           # 24
531 $a = -123._456; print "$a\n";           # 25
532 $a = -123.4_56; print "$a\n";   
533 $a = -123.45_6; print "$a\n";
534 $a = -123.456_; print "$a\n";           # 28
535 $a = 123.456E_12; printf("%.0f\n", $a); # 29
536 $a = 123.456E1_2; printf("%.0f\n", $a);
537 $a = 123.456E12_; printf("%.0f\n", $a); # 31
538 $a = 123.456E_+12; printf("%.0f\n", $a);        # 32
539 $a = 123.456E+_12; printf("%.0f\n", $a);        # 33
540 $a = 123.456E+1_2; printf("%.0f\n", $a);
541 $a = 123.456E+12_; printf("%.0f\n", $a);        # 35
542 $a = 123.456E_-12; print "$a\n";        # 36
543 $a = 123.456E-_12; print "$a\n";        # 37
544 $a = 123.456E-1_2; print "$a\n";
545 $a = 123.456E-12_; print "$a\n";        # 39
546 $a = 1__23; print "$a\n";               # 40
547 $a = 12.3__4; print "$a\n";             # 41
548 $a = 12.34e1__2; printf("%.0f\n", $a);  # 42
549 no warnings 'syntax' ;
550 $a = _123; print "$a\n";
551 $a = 1_23; print "$a\n";
552 $a = 12_3; print "$a\n";
553 $a = 123_; print "$a\n";
554 $a = _+123; print "$a\n";
555 $a = +_123; print "$a\n";
556 $a = +1_23; print "$a\n";
557 $a = +12_3; print "$a\n";
558 $a = +123_; print "$a\n";
559 $a = _-123; print "$a\n";
560 $a = -_123; print "$a\n";
561 $a = -1_23; print "$a\n";
562 $a = -12_3; print "$a\n";
563 $a = -123_; print "$a\n";
564 $a = 123._456; print "$a\n";
565 $a = 123.4_56; print "$a\n";
566 $a = 123.45_6; print "$a\n";
567 $a = 123.456_; print "$a\n";
568 $a = +123._456; print "$a\n";
569 $a = +123.4_56; print "$a\n";
570 $a = +123.45_6; print "$a\n";
571 $a = +123.456_; print "$a\n";
572 $a = -123._456; print "$a\n";
573 $a = -123.4_56; print "$a\n";
574 $a = -123.45_6; print "$a\n";
575 $a = -123.456_; print "$a\n";
576 $a = 123.456E_12; printf("%.0f\n", $a);
577 $a = 123.456E1_2; printf("%.0f\n", $a);
578 $a = 123.456E12_; printf("%.0f\n", $a);
579 $a = 123.456E_+12; printf("%.0f\n", $a);
580 $a = 123.456E+_12; printf("%.0f\n", $a);
581 $a = 123.456E+1_2; printf("%.0f\n", $a);
582 $a = 123.456E+12_; printf("%.0f\n", $a);
583 $a = 123.456E_-12; print "$a\n";
584 $a = 123.456E-_12; print "$a\n";
585 $a = 123.456E-1_2; print "$a\n";
586 $a = 123.456E-12_; print "$a\n";
587 $a = 1__23; print "$a\n";
588 $a = 12.3__4; print "$a\n";
589 $a = 12.34e1__2; printf("%.0f\n", $a);
590 EXPECT
591 OPTIONS regex
592 Misplaced _ in number at - line 6.
593 Misplaced _ in number at - line 11.
594 Misplaced _ in number at - line 16.
595 Misplaced _ in number at - line 17.
596 Misplaced _ in number at - line 20.
597 Misplaced _ in number at - line 21.
598 Misplaced _ in number at - line 24.
599 Misplaced _ in number at - line 25.
600 Misplaced _ in number at - line 28.
601 Misplaced _ in number at - line 29.
602 Misplaced _ in number at - line 31.
603 Misplaced _ in number at - line 32.
604 Misplaced _ in number at - line 33.
605 Misplaced _ in number at - line 35.
606 Misplaced _ in number at - line 36.
607 Misplaced _ in number at - line 37.
608 Misplaced _ in number at - line 39.
609 Misplaced _ in number at - line 40.
610 Misplaced _ in number at - line 41.
611 Misplaced _ in number at - line 42.
612 _123
613 123
614 123
615 123
616 123
617 _123
618 123
619 123
620 123
621 -123
622 -_123
623 -123
624 -123
625 -123
626 123.456
627 123.456
628 123.456
629 123.456
630 123.456
631 123.456
632 123.456
633 123.456
634 -123.456
635 -123.456
636 -123.456
637 -123.456
638 123456000000000
639 123456000000000
640 123456000000000
641 123456000000000
642 123456000000000
643 123456000000000
644 123456000000000
645 1.23456e-0?10
646 1.23456e-0?10
647 1.23456e-0?10
648 1.23456e-0?10
649 123
650 12.34
651 12340000000000
652 _123
653 123
654 123
655 123
656 123
657 _123
658 123
659 123
660 123
661 -123
662 -_123
663 -123
664 -123
665 -123
666 123.456
667 123.456
668 123.456
669 123.456
670 123.456
671 123.456
672 123.456
673 123.456
674 -123.456
675 -123.456
676 -123.456
677 -123.456
678 123456000000000
679 123456000000000
680 123456000000000
681 123456000000000
682 123456000000000
683 123456000000000
684 123456000000000
685 1.23456e-0?10
686 1.23456e-0?10
687 1.23456e-0?10
688 1.23456e-0?10
689 123
690 12.34
691 12340000000000
692 ########
693 # toke.c
694 use warnings 'bareword' ;
695 #line 25 "bar"
696 $a = FRED:: ;
697 no warnings 'bareword' ;
698 #line 25 "bar"
699 $a = FRED:: ;
700 EXPECT
701 Bareword "FRED::" refers to nonexistent package at bar line 25.
702 ########
703 # toke.c
704 use utf8;
705 use open qw( :utf8 :std );
706 use warnings 'bareword' ;
707 #line 25 "bar"
708 $a = FRÈD:: ;
709 no warnings 'bareword' ;
710 #line 25 "bar"
711 $a = FRÈD:: ;
712 EXPECT
713 Bareword "FRÈD::" refers to nonexistent package at bar line 25.
714 ########
715 # toke.c
716 use utf8;
717 use open qw( :utf8 :std );
718 use warnings 'bareword' ;
719 #line 25 "bar"
720 $a = ϞϞϞ:: ;
721 no warnings 'bareword' ;
722 #line 25 "bar"
723 $a = ϞϞϞ:: ;
724 EXPECT
725 Bareword "ϞϞϞ::" refers to nonexistent package at bar line 25.
726 ########
727 # toke.c
728 use warnings 'ambiguous' ;
729 sub time {}
730 my $a = time() ;
731 no warnings 'ambiguous' ;
732 my $b = time() ;
733 EXPECT
734 Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4.
735 ########
736 # toke.c
737 use warnings ;
738 eval <<'EOE';
739 #  line 30 "foo"
740 warn "yelp";
741 {
742   $_ = " \x{123} " ;
743 }
744 EOE
745 EXPECT
746 yelp at foo line 30.
747 ########
748 # toke.c
749 my $a = rand + 4 ;
750 $a = rand *^H ;
751 $a = rand $^H ;
752 EXPECT
753 Warning: Use of "rand" without parentheses is ambiguous at - line 2.
754 ########
755 # toke.c
756 $^W = 0 ;
757 my $a = rand + 4 ;
758 {
759     no warnings 'ambiguous' ;
760     $a = rand + 4 ;
761     use warnings 'ambiguous' ;
762     $a = rand + 4 ;
763 }
764 $a = rand + 4 ;
765 EXPECT
766 Warning: Use of "rand" without parentheses is ambiguous at - line 3.
767 Warning: Use of "rand" without parentheses is ambiguous at - line 8.
768 Warning: Use of "rand" without parentheses is ambiguous at - line 10.
769 ########
770 # [perl #97110]
771 sub myrand(;$) { }
772 sub whatever($) { }
773 my $a = myrand + 4 ;
774 my $b = whatever + 4 ;
775 EXPECT
776 Warning: Use of "myrand" without parentheses is ambiguous at - line 4.
777 ########
778 # toke.c
779 use warnings "ambiguous";
780 print for keys %+; # should not warn
781 EXPECT
782 ########
783 # toke.c
784 sub fred {};
785 -fred ;
786 sub hank : lvalue {$_}
787 --hank; # This should *not* warn [perl #77240]
788 EXPECT
789 Ambiguous use of -fred resolved as -&fred() at - line 3.
790 ########
791 # toke.c
792 $^W = 0 ;
793 sub fred {} ;
794 -fred ;
795 {
796     no warnings 'ambiguous' ;
797     -fred ;
798     use warnings 'ambiguous' ;
799     -fred ;
800 }
801 -fred ;
802 EXPECT
803 Ambiguous use of -fred resolved as -&fred() at - line 4.
804 Ambiguous use of -fred resolved as -&fred() at - line 9.
805 Ambiguous use of -fred resolved as -&fred() at - line 11.
806 ########
807 # toke.c
808 use utf8;
809 use open qw( :utf8 :std );
810 sub frèd {};
811 -frèd ;
812 EXPECT
813 Ambiguous use of -frèd resolved as -&frèd() at - line 5.
814 ########
815 # toke.c
816 $^W = 0 ;
817 use utf8;
818 use open qw( :utf8 :std );
819 sub frèd {} ;
820 -frèd ;
821 {
822     no warnings 'ambiguous' ;
823     -frèd ;
824     use warnings 'ambiguous' ;
825     -frèd ;
826 }
827 -frèd ;
828 EXPECT
829 Ambiguous use of -frèd resolved as -&frèd() at - line 6.
830 Ambiguous use of -frèd resolved as -&frèd() at - line 11.
831 Ambiguous use of -frèd resolved as -&frèd() at - line 13.
832 ########
833 # toke.c
834 use utf8;
835 use open qw( :utf8 :std );
836 sub ᒍᒘᒊ {};
837 -ᒍᒘᒊ ;
838 EXPECT
839 Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 5.
840 ########
841 # toke.c
842 $^W = 0 ;
843 use utf8;
844 use open qw( :utf8 :std );
845 sub ᒍᒘᒊ {} ;
846 -ᒍᒘᒊ ;
847 {
848     no warnings 'ambiguous' ;
849     -ᒍᒘᒊ ;
850     use warnings 'ambiguous' ;
851     -ᒍᒘᒊ ;
852 }
853 -ᒍᒘᒊ ;
854 EXPECT
855 Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 6.
856 Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 11.
857 Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 13.
858 ########
859 # toke.c
860 open FOO || time;
861 open local *FOO; # should be ok
862 EXPECT
863 Precedence problem: open FOO should be open(FOO) at - line 2.
864 ########
865 # toke.c
866 use utf8;
867 use open qw( :utf8 :std );
868 open FÒÒ || time;
869 EXPECT
870 Precedence problem: open FÒÒ should be open(FÒÒ) at - line 4.
871 ########
872 # toke.c
873 use utf8;
874 use open qw( :utf8 :std );
875 open ᒍOO || time;
876 EXPECT
877 Precedence problem: open ᒍOO should be open(ᒍOO) at - line 4.
878 ########
879 # toke.c (and [perl #16184])
880 open FOO => "<&0"; close FOO;
881 EXPECT
882 ########
883 # toke.c
884 $^W = 0 ;
885 open FOO || time;
886 {
887     no warnings 'precedence' ;
888     open FOO || time;
889     use warnings 'precedence' ;
890     open FOO || time;
891 }
892 open FOO || time;
893 open Foo::BAR; # this should not warn
894 EXPECT
895 Precedence problem: open FOO should be open(FOO) at - line 3.
896 Precedence problem: open FOO should be open(FOO) at - line 8.
897 Precedence problem: open FOO should be open(FOO) at - line 10.
898 ########
899 # toke.c
900 $^W = 0 ;
901 use utf8;
902 use open qw( :utf8 :std );
903 open FÒÒ || time;
904 {
905     no warnings 'precedence' ;
906     open FÒÒ || time;
907     use warnings 'precedence' ;
908     open FÒÒ || time;
909 }
910 open FÒÒ || time;
911 EXPECT
912 Precedence problem: open FÒÒ should be open(FÒÒ) at - line 5.
913 Precedence problem: open FÒÒ should be open(FÒÒ) at - line 10.
914 Precedence problem: open FÒÒ should be open(FÒÒ) at - line 12.
915 ########
916 # toke.c
917 use utf8;
918 use open qw( :utf8 :std );
919 $^W = 0 ;
920 open ᒍÒÒ || time;
921 {
922     no warnings 'precedence' ;
923     open ᒍÒÒ || time;
924     use warnings 'precedence' ;
925     open ᒍÒÒ || time;
926 }
927 open ᒍÒÒ || time;
928 EXPECT
929 Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 5.
930 Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 10.
931 Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 12.
932 ########
933 # toke.c
934 $^W = 0 ;
935 *foo *foo ;
936 {
937     no warnings 'ambiguous' ;
938     *foo *foo ;
939     use warnings 'ambiguous' ;
940     *foo *foo ;
941 }
942 *foo *foo ;
943 # These should not warn [perl #117535]:
944 foo**foo ;
945 no warnings 'deprecated';
946 sort $*foo ;
947 sort $ *foo ;
948 EXPECT
949 Operator or semicolon missing before *foo at - line 3.
950 Ambiguous use of * resolved as operator * at - line 3.
951 Operator or semicolon missing before *foo at - line 8.
952 Ambiguous use of * resolved as operator * at - line 8.
953 Operator or semicolon missing before *foo at - line 10.
954 Ambiguous use of * resolved as operator * at - line 10.
955 ########
956 # toke.c
957 $^W = 0 ;
958 %foo %foo ;
959 {
960     no warnings 'ambiguous' ;
961     %foo %foo ;
962     use warnings 'ambiguous' ;
963     %foo %foo ;
964 }
965 %foo %foo ;
966 # This should not produce ambiguity warnings [perl #117535]:
967 sort $%foo ;
968 sort $ %foo ;
969 EXPECT
970 Operator or semicolon missing before %foo at - line 3.
971 Ambiguous use of % resolved as operator % at - line 3.
972 Operator or semicolon missing before %foo at - line 8.
973 Ambiguous use of % resolved as operator % at - line 8.
974 Operator or semicolon missing before %foo at - line 10.
975 Ambiguous use of % resolved as operator % at - line 10.
976 Bareword found where operator expected at - line 12, near "$%foo"
977         (Missing operator before foo?)
978 Bareword found where operator expected at - line 13, near "$ %foo"
979         (Missing operator before foo?)
980 Illegal modulus zero at - line 3.
981 ########
982 # toke.c
983 $^W = 0 ;
984 &foo &foo ;
985 {
986     no warnings 'ambiguous' ;
987     &foo &foo ;
988     use warnings 'ambiguous' ;
989     &foo &foo ;
990 }
991 &foo &foo ;
992 # These should not warn produce ambiguity warnings [perl #76910]:
993 foo&&foo ;
994 sort $&foo ;
995 sort $ &foo ;
996 EXPECT
997 Operator or semicolon missing before &foo at - line 3.
998 Ambiguous use of & resolved as operator & at - line 3.
999 Operator or semicolon missing before &foo at - line 8.
1000 Ambiguous use of & resolved as operator & at - line 8.
1001 Operator or semicolon missing before &foo at - line 10.
1002 Ambiguous use of & resolved as operator & at - line 10.
1003 Bareword found where operator expected at - line 13, near "$&foo"
1004         (Missing operator before foo?)
1005 Bareword found where operator expected at - line 14, near "$ &foo"
1006         (Missing operator before foo?)
1007 Undefined subroutine &main::foo called at - line 3.
1008 ########
1009 # toke.c
1010 use utf8;
1011 use open qw( :utf8 :std );
1012 $^W = 0 ;
1013 *foo *foo ;
1014 {
1015     no warnings 'ambiguous' ;
1016     *foo *foo ;
1017     use warnings 'ambiguous' ;
1018     *foo *foo ;
1019 }
1020 *foo *foo ;
1021 EXPECT
1022 Operator or semicolon missing before *foo at - line 5.
1023 Ambiguous use of * resolved as operator * at - line 5.
1024 Operator or semicolon missing before *foo at - line 10.
1025 Ambiguous use of * resolved as operator * at - line 10.
1026 Operator or semicolon missing before *foo at - line 12.
1027 Ambiguous use of * resolved as operator * at - line 12.
1028 ########
1029 # toke.c
1030 use warnings 'misc' ;
1031 my $a = "\m" ;
1032 no warnings 'misc' ;
1033 $a = "\m" ;
1034 EXPECT
1035 Unrecognized escape \m passed through at - line 3.
1036 ########
1037 # toke.c
1038 use warnings 'misc' ;
1039 my $a = "abcd\E" ;
1040 no warnings 'misc' ;
1041 $a = "abcd\E" ;
1042 EXPECT
1043 Useless use of \E at - line 3.
1044 ########
1045 # toke.c
1046 use feature 'postderef', 'postderef_qq';
1047 (\$_)->$*;
1048 "$_->$*";
1049 no warnings 'experimental::postderef';
1050 (\$_)->$*;
1051 "$_->$*";
1052 EXPECT
1053 Postfix dereference is experimental at - line 3.
1054 Postfix dereference is experimental at - line 4.
1055 ########
1056 # toke.c
1057 use warnings 'portable' ;
1058 my $a =  0b011111111111111111111111111111110 ;
1059    $a =  0b011111111111111111111111111111111 ;
1060    $a =  0b111111111111111111111111111111111 ;
1061    $a =  0x0fffffffe ;
1062    $a =  0x0ffffffff ;
1063    $a =  0x1ffffffff ;
1064    $a =  0037777777776 ;
1065    $a =  0037777777777 ;
1066    $a =  0047777777777 ;
1067 no warnings 'portable' ;
1068    $a =  0b011111111111111111111111111111110 ;
1069    $a =  0b011111111111111111111111111111111 ;
1070    $a =  0b111111111111111111111111111111111 ;
1071    $a =  0x0fffffffe ;
1072    $a =  0x0ffffffff ;
1073    $a =  0x1ffffffff ;
1074    $a =  0037777777776 ;
1075    $a =  0037777777777 ;
1076    $a =  0047777777777 ;
1077 EXPECT
1078 Binary number > 0b11111111111111111111111111111111 non-portable at - line 5.
1079 Hexadecimal number > 0xffffffff non-portable at - line 8.
1080 Octal number > 037777777777 non-portable at - line 11.
1081 ########
1082 # toke.c
1083 use warnings 'overflow' ;
1084 my $a =  0b011111111111111111111111111111110 ;
1085    $a =  0b011111111111111111111111111111111 ;
1086    $a =  0b10000000000000000000000000000000000000000000000000000000000000000 ;
1087    $a =  0x0fffffffe ;
1088    $a =  0x0ffffffff ;
1089    $a =  0x10000000000000000 ;
1090    $a =  0037777777776 ;
1091    $a =  0037777777777 ;
1092    $a =  002000000000000000000000;
1093 no warnings 'overflow' ;
1094    $a =  0b011111111111111111111111111111110 ;
1095    $a =  0b011111111111111111111111111111111 ;
1096    $a =  0b10000000000000000000000000000000000000000000000000000000000000000 ;
1097    $a =  0x0fffffffe ;
1098    $a =  0x0ffffffff ;
1099    $a =  0x10000000000000000 ;
1100    $a =  0037777777776 ;
1101    $a =  0037777777777 ;
1102    $a =  002000000000000000000000;
1103 EXPECT
1104 Integer overflow in binary number at - line 5.
1105 Integer overflow in hexadecimal number at - line 8.
1106 Integer overflow in octal number at - line 11.
1107 ########
1108 # toke.c
1109 BEGIN { $^C = 1; }
1110 use warnings 'misc';
1111 dump;
1112 CORE::dump;
1113 EXPECT
1114 dump() better written as CORE::dump() at - line 4.
1115 - syntax OK
1116 ########
1117 # toke.c
1118 use warnings 'misc';
1119 use subs qw/dump/;
1120 sub dump { print "no warning for overridden dump\n"; }
1121 dump;
1122 EXPECT
1123 no warning for overridden dump
1124 ########
1125 # toke.c
1126 use warnings 'ambiguous';
1127 "@mjd_previously_unused_array";        
1128 no warnings 'ambiguous';
1129 "@mjd_previously_unused_array2";        
1130 EXPECT
1131 Possible unintended interpolation of @mjd_previously_unused_array in string at - line 3.
1132 ########
1133 # toke.c
1134 use utf8;
1135 use open qw( :utf8 :std );
1136 use warnings 'ambiguous';
1137 "@mjd_previously_unused_àrray";        
1138 no warnings 'ambiguous';
1139 "@mjd_previously_unused_àrray2";        
1140 EXPECT
1141 Possible unintended interpolation of @mjd_previously_unused_àrray in string at - line 5.
1142 ########
1143 # toke.c
1144 use utf8;
1145 use open qw( :utf8 :std );
1146 use warnings 'ambiguous';
1147 "@mjd_previously_unused_ぁrrぁy";        
1148 no warnings 'ambiguous';
1149 "@mjd_previously_unused_ぁrrぁy2";        
1150 EXPECT
1151 Possible unintended interpolation of @mjd_previously_unused_ぁrrぁy in string at - line 5.
1152 ########
1153 # toke.c
1154 # 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com
1155 use warnings 'regexp';
1156 "foo" =~ /foo/c;
1157 "foo" =~ /foo/cg;
1158 no warnings 'regexp';
1159 "foo" =~ /foo/c;
1160 "foo" =~ /foo/cg;
1161 EXPECT
1162 Use of /c modifier is meaningless without /g at - line 4.
1163 ########
1164 # toke.c
1165 # 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com
1166 use warnings 'regexp';
1167 $_ = "ab" ; 
1168 s/ab/ab/c;
1169 s/ab/ab/cg;
1170 no warnings 'regexp';
1171 s/ab/ab/c;
1172 s/ab/ab/cg;
1173 EXPECT
1174 Use of /c modifier is meaningless in s/// at - line 5.
1175 Use of /c modifier is meaningless in s/// at - line 6.
1176 ########
1177 -wa
1178 # toke.c
1179 # 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings
1180 print "@F\n";
1181 EXPECT
1182
1183 ########
1184 -w
1185 # toke.c
1186 # 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings
1187 print "@F\n";
1188 EXPECT
1189 Possible unintended interpolation of @F in string at - line 4.
1190 Name "main::F" used only once: possible typo at - line 4.
1191 ########
1192 -wa
1193 # toke.c
1194 # 20020414 mjd-perl-patch+@plover.com
1195 EXPECT
1196
1197 ########
1198 # toke.c
1199 # 20020414 mjd-perl-patch+@plover.com
1200 # In 5.7.3, this emitted "Possible unintended interpolation" warnings
1201 use warnings 'ambiguous';
1202 $s = "(@-)(@+)";
1203 EXPECT
1204
1205 ########
1206 # toke.c
1207 # mandatory warning
1208 eval q/if ($a) { } elseif ($b) { }/;
1209 no warnings "syntax";
1210 eval q/if ($a) { } elseif ($b) { }/;
1211 EXPECT
1212 elseif should be elsif at (eval 1) line 1.
1213 ########
1214 # toke.c
1215 # mandatory warning
1216 eval q/5 6/;
1217 no warnings "syntax";
1218 eval q/5 6/;
1219 EXPECT
1220 Number found where operator expected at (eval 1) line 1, near "5 6"
1221         (Missing operator before  6?)
1222 ########
1223 # toke.c
1224 use warnings "syntax"; no warnings "deprecated";
1225 $_ = $a = 1;
1226 $a !=~  /1/;
1227 $a !=~ m#1#;
1228 $a !=~/1/;
1229 $a !=~ ?/?;
1230 $a !=~ y/1//;
1231 $a !=~ tr/1//;
1232 $a !=~ s/1//;
1233 $a != ~/1/;
1234 no warnings "syntax";
1235 $a !=~  /1/;
1236 $a !=~ m#1#;
1237 $a !=~/1/;
1238 $a !=~ ?/?;
1239 $a !=~ y/1//;
1240 $a !=~ tr/1//;
1241 $a !=~ s/1//;
1242 EXPECT
1243 !=~ should be !~ at - line 4.
1244 !=~ should be !~ at - line 5.
1245 !=~ should be !~ at - line 6.
1246 !=~ should be !~ at - line 7.
1247 !=~ should be !~ at - line 8.
1248 !=~ should be !~ at - line 9.
1249 !=~ should be !~ at - line 10.
1250 ########
1251 # toke.c
1252 our $foo :unique;
1253 sub pam :locked;
1254 sub glipp :locked {
1255 }
1256 sub whack_eth ($) : locked {
1257 }
1258 no warnings 'deprecated';
1259 our $bar :unique;
1260 sub zapeth :locked;
1261 sub ker_plop :locked {
1262 }
1263 sub swa_a_p ($) : locked {
1264 }
1265 EXPECT
1266 Use of :unique is deprecated at - line 2.
1267 Use of :locked is deprecated at - line 3.
1268 Use of :locked is deprecated at - line 4.
1269 Use of :locked is deprecated at - line 6.
1270 ########
1271 # toke.c
1272 use warnings "syntax"; use feature 'lexical_subs';
1273 sub proto_after_array(@$);
1274 sub proto_after_arref(\@$);
1275 sub proto_after_arref2(\[@$]);
1276 sub proto_after_arref3(\[@$]_);
1277 sub proto_after_hash(%$);
1278 sub proto_after_hashref(\%$);
1279 sub proto_after_hashref2(\[%$]);
1280 sub underscore_last_pos($_);
1281 sub underscore2($_;$);
1282 sub underscore_fail($_$);
1283 sub underscore_after_at(@_);
1284 our sub hour (@$);
1285 my sub migh (@$);
1286 use feature 'state';
1287 state sub estate (@$);
1288 package other;
1289 sub hour (@$);
1290 sub migh (@$);
1291 sub estate (@$);
1292 no warnings "syntax";
1293 sub proto_after_array(@$);
1294 sub proto_after_hash(%$);
1295 sub underscore_fail($_$);
1296 EXPECT
1297 Prototype after '@' for main::proto_after_array : @$ at - line 3.
1298 Prototype after '%' for main::proto_after_hash : %$ at - line 7.
1299 Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12.
1300 Prototype after '@' for main::underscore_after_at : @_ at - line 13.
1301 The lexical_subs feature is experimental at - line 14.
1302 Prototype after '@' for hour : @$ at - line 14.
1303 The lexical_subs feature is experimental at - line 15.
1304 Prototype after '@' for migh : @$ at - line 15.
1305 The lexical_subs feature is experimental at - line 17.
1306 Prototype after '@' for estate : @$ at - line 17.
1307 Prototype after '@' for hour : @$ at - line 19.
1308 Prototype after '@' for migh : @$ at - line 20.
1309 Prototype after '@' for estate : @$ at - line 21.
1310 ########
1311 # toke.c
1312 use warnings "ambiguous";
1313 "foo\nn" =~ /^foo$\n/;
1314 "foo\nn" =~ /^foo${\}n/;
1315 my $foo = qr/^foo$\n/;
1316 my $bar = qr/^foo${\}n/;
1317 no warnings "ambiguous";
1318 "foo\nn" =~ /^foo$\n/;
1319 "foo\nn" =~ /^foo${\}n/;
1320 my $foo = qr/^foo$\n/;
1321 my $bar = qr/^foo${\}n/;
1322 EXPECT
1323 Possible unintended interpolation of $\ in regex at - line 3.
1324 Possible unintended interpolation of $\ in regex at - line 5.
1325 ########
1326 # toke.c
1327 use warnings 'syntax' ;
1328 my $a = "\o";
1329 my $a = "\o{";
1330 my $a = "\o{}";
1331 no warnings 'syntax' ;
1332 my $a = "\o";
1333 my $a = "\o{";
1334 my $a = "\o{}";
1335 EXPECT
1336 Missing braces on \o{} at - line 3, within string
1337 Missing right brace on \o{ at - line 4, within string
1338 Number with no digits at - line 5, within string
1339 BEGIN not safe after errors--compilation aborted at - line 6.
1340 ########
1341 # toke.c
1342 use warnings 'digit' ;
1343 my $a = "\o{1238456}";
1344 no warnings 'digit' ;
1345 my $a = "\o{1238456}";
1346 EXPECT
1347 Non-octal character '8'.  Resolved as "\o{123}" at - line 3.
1348 ########
1349 # toke.c
1350 use warnings;
1351 my $a = "foo";
1352 print $a =~ ?f? ? "yes\n" : "no\n" foreach 0..2;
1353 EXPECT
1354 Use of ?PATTERN? without explicit operator is deprecated at - line 4.
1355 yes
1356 no
1357 no
1358 ########
1359 # toke.c
1360 use warnings;
1361 my $a = "\c{ack}";
1362 $a = "\c,";
1363 $a = "\c`";
1364 no warnings 'syntax';
1365 $a = "\c{ack}";
1366 $a = "\c,";
1367 $a = "\c`";
1368 no warnings 'deprecated';
1369 EXPECT
1370 "\c{" is deprecated and is more clearly written as ";" at - line 3.
1371 "\c," is more clearly written simply as "l" at - line 4.
1372 "\c`" is more clearly written simply as "\ " at - line 5.
1373 "\c{" is deprecated and is more clearly written as ";" at - line 7.
1374 ########
1375 # toke.c
1376 use warnings 'syntax' ;
1377 my $a = qr/foo/du;
1378 $a = qr/foo/lai;
1379 $a = qr/foo/lil;
1380 $a = qr/foo/aia;
1381 $a = qr/foo/aaia;
1382 no warnings 'syntax' ;
1383 my $a = qr/foo/du;
1384 EXPECT
1385 Regexp modifiers "/d" and "/u" are mutually exclusive at - line 3, near "= "
1386 Regexp modifiers "/l" and "/a" are mutually exclusive at - line 4, near "= "
1387 Regexp modifier "/l" may not appear twice at - line 5, near "= "
1388 Regexp modifier "/a" may appear a maximum of twice at - line 7, near "= "
1389 BEGIN not safe after errors--compilation aborted at - line 8.
1390 ########
1391 # toke.c
1392 # [perl #4362]
1393 eval "print q\xabfoo";
1394 print "ok\n" if
1395     $@ =~ /Can't find string terminator "\xab" anywhere before EOF/;
1396 EXPECT
1397 ok
1398 ########
1399 # toke.c
1400 use utf8;
1401 use open qw( :utf8 :std );
1402 use warnings 'ambiguous' ;
1403 sub frèd {}
1404 $a = ${frèd} ;
1405 no warnings 'ambiguous' ;
1406 $a = ${frèd} ;
1407 EXPECT
1408 Ambiguous use of ${frèd} resolved to $frèd at - line 6.
1409 ########
1410 # toke.c
1411 use utf8;
1412 use open qw( :utf8 :std );
1413 use warnings 'ambiguous' ;
1414 sub f렏 {}
1415 $a = ${f렏} ;
1416 no warnings 'ambiguous' ;
1417 $a = ${f렏} ;
1418 EXPECT
1419 Ambiguous use of ${f렏} resolved to $f렏 at - line 6.
1420 ########
1421 # toke.c
1422 use utf8;
1423 use open qw( :utf8 :std );
1424 use warnings;
1425 CORE::렏;
1426 EXPECT
1427 CORE::렏 is not a keyword at - line 5.
1428 ########
1429 # toke.c
1430 # [perl #16249]
1431 print '';
1432 eval this_method_is_fake ();
1433 EXPECT
1434 Undefined subroutine &main::this_method_is_fake called at - line 4.
1435 ########
1436 # toke.c
1437 # [perl #107002] Erroneous ambiguity warnings
1438 sub { # do not actually call require
1439   require a::b . 1; # These used to produce erroneous
1440   require a::b + 1; # ambiguity warnings.
1441 }
1442 EXPECT
1443 ########
1444 # toke.c
1445 # [perl #113094], [perl #119101]
1446 print "aa" =~ m{^a\{1,2\}$}, "\n";
1447 print "aa" =~ m{^a\x\{61\}$}, "\n";
1448 print "a\\x{6F}" =~ m{^a\\x\{6F\}$}, "\n";
1449 print "a\\o" =~ m{^a\\\x\{6F\}$}, "\n";
1450 print "a\\\\x{6F}" =~ m{^a\\\\x\{6F\}$}, "\n";
1451 print "a\\\\o"     =~ m{^a\\\\\x\{6F\}$}, "\n";
1452 print "aa" =~ m{^a{1,2}$}, "\n";
1453 print "aq" =~ m[^a\[a-z\]$], "\n";
1454 print "aq" =~ m(^a\(q\)$), "\n";
1455 no warnings 'deprecated';
1456 print "aa" =~ m{^a\{1,2\}$}, "\n";
1457 print "aa" =~ m{^a\x\{61\}$}, "\n";
1458 print "a\\x{6F}" =~ m{^a\\x\{6F\}$}, "\n";
1459 print "a\\o" =~ m{^a\\\x\{6f\}$}, "\n";
1460 print "aq" =~ m[^a\[a-z\]$], "\n";
1461 print "aq" =~ m(^a\(q\)$), "\n";
1462 EXPECT
1463 Useless use of '\'; doesn't escape metacharacter '{' at - line 3.
1464 Useless use of '\'; doesn't escape metacharacter '{' at - line 4.
1465 Useless use of '\'; doesn't escape metacharacter '{' at - line 6.
1466 Useless use of '\'; doesn't escape metacharacter '{' at - line 8.
1467 Useless use of '\'; doesn't escape metacharacter '[' at - line 10.
1468 Useless use of '\'; doesn't escape metacharacter '(' at - line 11.
1469 1
1470 1
1471 1
1472 1
1473 1
1474 1
1475 1
1476 1
1477 q
1478 1
1479 1
1480 1
1481 1
1482 1
1483 q
1484 ########
1485 # toke.c
1486 #[perl #119123] disallow literal control character variables
1487 eval "\$\cQ = 25";
1488 eval "\${ \cX } = 24";
1489 *{
1490     Foo
1491 }; # shouldn't warn on {\n, even though \n is a control character
1492 EXPECT
1493 Use of literal control characters in variable names is deprecated at (eval 1) line 1.
1494 Use of literal control characters in variable names is deprecated at (eval 2) line 1.