was (Re: [PATCH] MakeMaker 5.55_03 -> 5.90_01)
[p5sagit/p5-mst-13.2.git] / t / lib / warnings / toke
CommitLineData
599cee73 1toke.c AOK
2
3 we seem to have lost a few ambiguous warnings!!
4
5
599cee73 6 $a = <<;
7 Use of comma-less variable list is deprecated
8 (called 3 times via depcom)
9
10 \1 better written as $1
4438c4b7 11 use warnings 'syntax' ;
599cee73 12 s/(abc)/\1/;
13
14 warn(warn_nosemi)
15 Semicolon seems to be missing
16 $a = 1
17 &time ;
18
19
20 Reversed %c= operator
21 my $a =+ 2 ;
22 $a =- 2 ;
23 $a =* 2 ;
24 $a =% 2 ;
25 $a =& 2 ;
26 $a =. 2 ;
27 $a =^ 2 ;
28 $a =| 2 ;
29 $a =< 2 ;
30 $a =/ 2 ;
31
32 Multidimensional syntax %.*s not supported
33 my $a = $a[1,2] ;
34
35 You need to quote \"%s\""
36 sub fred {} ; $SIG{TERM} = fred;
37
38 Scalar value %.*s better written as $%.*s"
39 @a[3] = 2;
40 @a{3} = 2;
41
42 Can't use \\%c to mean $%c in expression
43 $_ = "ab" ; s/(ab)/\1/e;
44
45 Unquoted string "abc" may clash with future reserved word at - line 3.
46 warn(warn_reserved
47 $a = abc;
48
599cee73 49 Possible attempt to separate words with commas
50 @a = qw(a, b, c) ;
51
52 Possible attempt to put comments in qw() list
53 @a = qw(a b # c) ;
54
599cee73 55 %s (...) interpreted as function
56 print ("")
57 printf ("")
58 sort ("")
59
60 Ambiguous use of %c{%s%s} resolved to %c%s%s
61 $a = ${time[2]}
62 $a = ${time{2}}
63
64
65 Ambiguous use of %c{%s} resolved to %c%s
66 $a = ${time}
67 sub fred {} $a = ${fred}
68
69 Misplaced _ in number
70 $a = 1_2;
71 $a = 1_2345_6;
72
73 Bareword \"%s\" refers to nonexistent package
74 $a = FRED:: ;
75
76 Ambiguous call resolved as CORE::%s(), qualify as such or use &
77 sub time {}
78 my $a = time()
79
767a6a26 80 Unrecognized escape \\%c passed through
81 $a = "\m" ;
82
83 %s number > %s non-portable
84 my $a = 0b011111111111111111111111111111110 ;
85 $a = 0b011111111111111111111111111111111 ;
86 $a = 0b111111111111111111111111111111111 ;
87 $a = 0x0fffffffe ;
88 $a = 0x0ffffffff ;
89 $a = 0x1ffffffff ;
90 $a = 0037777777776 ;
91 $a = 0037777777777 ;
92 $a = 0047777777777 ;
93
94 Integer overflow in binary number
95 my $a = 0b011111111111111111111111111111110 ;
96 $a = 0b011111111111111111111111111111111 ;
97 $a = 0b111111111111111111111111111111111 ;
98 $a = 0x0fffffffe ;
99 $a = 0x0ffffffff ;
100 $a = 0x1ffffffff ;
101 $a = 0037777777776 ;
102 $a = 0037777777777 ;
103 $a = 0047777777777 ;
ac206dc8 104
105 dump() better written as CORE::dump()
4ac733c9 106
107 Use of /c modifier is meaningless without /g
108
64e578a2 109 Use of /c modifier is meaningless in s///
110
0453d815 111 Mandatory Warnings
112 ------------------
113 Use of "%s" without parentheses is ambiguous [check_uni]
114 rand + 4
115
116 Ambiguous use of -%s resolved as -&%s() [yylex]
117 sub fred {} ; - fred ;
118
119 Precedence problem: open %.*s should be open(%.*s) [yylex]
120 open FOO || die;
121
122 Operator or semicolon missing before %c%s [yylex]
123 Ambiguous use of %c resolved as operator %c
124 *foo *foo
125
599cee73 126__END__
127# toke.c
a4f5cc89 128use warnings 'deprecated' ;
599cee73 129format STDOUT =
130@<<< @||| @>>> @>>>
131$a $b "abc" 'def'
132.
4438c4b7 133no warnings 'deprecated' ;
0453d815 134format STDOUT =
135@<<< @||| @>>> @>>>
136$a $b "abc" 'def'
137.
599cee73 138EXPECT
139Use of comma-less variable list is deprecated at - line 5.
140Use of comma-less variable list is deprecated at - line 5.
141Use of comma-less variable list is deprecated at - line 5.
599cee73 142########
143# toke.c
4438c4b7 144use warnings 'deprecated' ;
599cee73 145$a = <<;
146
4438c4b7 147no warnings 'deprecated' ;
0453d815 148$a = <<;
149
599cee73 150EXPECT
151Use of bare << to mean <<"" is deprecated at - line 3.
152########
153# toke.c
4438c4b7 154use warnings 'syntax' ;
599cee73 155s/(abc)/\1/;
4438c4b7 156no warnings 'syntax' ;
0453d815 157s/(abc)/\1/;
599cee73 158EXPECT
159\1 better written as $1 at - line 3.
160########
161# toke.c
4438c4b7 162use warnings 'semicolon' ;
599cee73 163$a = 1
164&time ;
4438c4b7 165no warnings 'semicolon' ;
0453d815 166$a = 1
167&time ;
599cee73 168EXPECT
169Semicolon seems to be missing at - line 3.
170########
171# toke.c
4438c4b7 172use warnings 'syntax' ;
599cee73 173my $a =+ 2 ;
174$a =- 2 ;
175$a =* 2 ;
176$a =% 2 ;
177$a =& 2 ;
178$a =. 2 ;
179$a =^ 2 ;
180$a =| 2 ;
181$a =< 2 ;
182$a =/ 2 ;
183EXPECT
7f01dc7a 184Reversed += operator at - line 3.
185Reversed -= operator at - line 4.
186Reversed *= operator at - line 5.
187Reversed %= operator at - line 6.
188Reversed &= operator at - line 7.
189Reversed .= operator at - line 8.
190Reversed ^= operator at - line 9.
191Reversed |= operator at - line 10.
192Reversed <= operator at - line 11.
193syntax error at - line 8, near "=."
194syntax error at - line 9, near "=^"
195syntax error at - line 10, near "=|"
196Unterminated <> operator at - line 11.
599cee73 197########
198# toke.c
4438c4b7 199no warnings 'syntax' ;
0453d815 200my $a =+ 2 ;
201$a =- 2 ;
202$a =* 2 ;
203$a =% 2 ;
204$a =& 2 ;
205$a =. 2 ;
206$a =^ 2 ;
207$a =| 2 ;
208$a =< 2 ;
209$a =/ 2 ;
210EXPECT
7f01dc7a 211syntax error at - line 8, near "=."
212syntax error at - line 9, near "=^"
213syntax error at - line 10, near "=|"
214Unterminated <> operator at - line 11.
0453d815 215########
216# toke.c
4438c4b7 217use warnings 'syntax' ;
599cee73 218my $a = $a[1,2] ;
4438c4b7 219no warnings 'syntax' ;
0453d815 220my $a = $a[1,2] ;
599cee73 221EXPECT
222Multidimensional syntax $a[1,2] not supported at - line 3.
223########
224# toke.c
4438c4b7 225use warnings 'syntax' ;
599cee73 226sub fred {} ; $SIG{TERM} = fred;
4438c4b7 227no warnings 'syntax' ;
0453d815 228$SIG{TERM} = fred;
599cee73 229EXPECT
230You need to quote "fred" at - line 3.
231########
232# toke.c
4438c4b7 233use warnings 'syntax' ;
599cee73 234@a[3] = 2;
235@a{3} = 2;
4438c4b7 236no warnings 'syntax' ;
0453d815 237@a[3] = 2;
238@a{3} = 2;
599cee73 239EXPECT
240Scalar value @a[3] better written as $a[3] at - line 3.
241Scalar value @a{3} better written as $a{3} at - line 4.
242########
243# toke.c
4438c4b7 244use warnings 'syntax' ;
599cee73 245$_ = "ab" ;
246s/(ab)/\1/e;
4438c4b7 247no warnings 'syntax' ;
0453d815 248$_ = "ab" ;
249s/(ab)/\1/e;
599cee73 250EXPECT
251Can't use \1 to mean $1 in expression at - line 4.
252########
253# toke.c
4438c4b7 254use warnings 'reserved' ;
599cee73 255$a = abc;
1c3923b3 256$a = { def
257
258=> 1 };
4438c4b7 259no warnings 'reserved' ;
0453d815 260$a = abc;
599cee73 261EXPECT
262Unquoted string "abc" may clash with future reserved word at - line 3.
263########
264# toke.c
e476b1b5 265use warnings 'qw' ;
599cee73 266@a = qw(a, b, c) ;
e476b1b5 267no warnings 'qw' ;
0453d815 268@a = qw(a, b, c) ;
599cee73 269EXPECT
270Possible attempt to separate words with commas at - line 3.
271########
272# toke.c
e476b1b5 273use warnings 'qw' ;
599cee73 274@a = qw(a b #) ;
e476b1b5 275no warnings 'qw' ;
0453d815 276@a = qw(a b #) ;
599cee73 277EXPECT
278Possible attempt to put comments in qw() list at - line 3.
279########
280# toke.c
4438c4b7 281use warnings 'syntax' ;
599cee73 282print ("")
283EXPECT
284print (...) interpreted as function at - line 3.
285########
286# toke.c
4438c4b7 287no warnings 'syntax' ;
0453d815 288print ("")
289EXPECT
290
291########
292# toke.c
4438c4b7 293use warnings 'syntax' ;
599cee73 294printf ("")
295EXPECT
296printf (...) interpreted as function at - line 3.
297########
298# toke.c
4438c4b7 299no warnings 'syntax' ;
0453d815 300printf ("")
301EXPECT
302
303########
304# toke.c
4438c4b7 305use warnings 'syntax' ;
599cee73 306sort ("")
307EXPECT
308sort (...) interpreted as function at - line 3.
309########
310# toke.c
4438c4b7 311no warnings 'syntax' ;
0453d815 312sort ("")
313EXPECT
314
315########
316# toke.c
4438c4b7 317use warnings 'ambiguous' ;
599cee73 318$a = ${time[2]};
4438c4b7 319no warnings 'ambiguous' ;
0453d815 320$a = ${time[2]};
599cee73 321EXPECT
322Ambiguous use of ${time[...]} resolved to $time[...] at - line 3.
323########
324# toke.c
4438c4b7 325use warnings 'ambiguous' ;
599cee73 326$a = ${time{2}};
327EXPECT
328Ambiguous use of ${time{...}} resolved to $time{...} at - line 3.
329########
330# toke.c
4438c4b7 331no warnings 'ambiguous' ;
0453d815 332$a = ${time{2}};
333EXPECT
334
335########
336# toke.c
4438c4b7 337use warnings 'ambiguous' ;
599cee73 338$a = ${time} ;
4438c4b7 339no warnings 'ambiguous' ;
0453d815 340$a = ${time} ;
599cee73 341EXPECT
342Ambiguous use of ${time} resolved to $time at - line 3.
343########
344# toke.c
4438c4b7 345use warnings 'ambiguous' ;
599cee73 346sub fred {}
347$a = ${fred} ;
4438c4b7 348no warnings 'ambiguous' ;
0453d815 349$a = ${fred} ;
599cee73 350EXPECT
351Ambiguous use of ${fred} resolved to $fred at - line 4.
352########
353# toke.c
4438c4b7 354use warnings 'syntax' ;
7fd134d9 355$a = _123; print "$a\n"; #( 3 string)
356$a = 1_23; print "$a\n";
357$a = 12_3; print "$a\n";
358$a = 123_; print "$a\n"; # 6
359$a = _+123; print "$a\n"; # 7 string)
360$a = +_123; print "$a\n"; #( 8 string)
361$a = +1_23; print "$a\n";
362$a = +12_3; print "$a\n";
363$a = +123_; print "$a\n"; # 11
364$a = _-123; print "$a\n"; #(12 string)
365$a = -_123; print "$a\n"; #(13 string)
366$a = -1_23; print "$a\n";
367$a = -12_3; print "$a\n";
368$a = -123_; print "$a\n"; # 16
369$a = 123._456; print "$a\n"; # 17
370$a = 123.4_56; print "$a\n";
371$a = 123.45_6; print "$a\n";
372$a = 123.456_; print "$a\n"; # 20
373$a = +123._456; print "$a\n"; # 21
374$a = +123.4_56; print "$a\n";
375$a = +123.45_6; print "$a\n";
376$a = +123.456_; print "$a\n"; # 24
377$a = -123._456; print "$a\n"; # 25
378$a = -123.4_56; print "$a\n";
379$a = -123.45_6; print "$a\n";
380$a = -123.456_; print "$a\n"; # 28
381$a = 123.456E_12; print "$a\n"; # 29
382$a = 123.456E1_2; print "$a\n";
383$a = 123.456E12_; print "$a\n"; # 31
384$a = 123.456E_+12; print "$a\n"; # 32
385$a = 123.456E+_12; print "$a\n"; # 33
386$a = 123.456E+1_2; print "$a\n";
387$a = 123.456E+12_; print "$a\n"; # 35
388$a = 123.456E_-12; print "$a\n"; # 36
389$a = 123.456E-_12; print "$a\n"; # 37
390$a = 123.456E-1_2; print "$a\n";
391$a = 123.456E-12_; print "$a\n"; # 39
b3b48e3e 392$a = 1__23; print "$a\n"; # 40
393$a = 12.3__4; print "$a\n"; # 41
394$a = 12.34e1__2; print "$a\n"; # 42
4438c4b7 395no warnings 'syntax' ;
7fd134d9 396$a = _123; print "$a\n";
397$a = 1_23; print "$a\n";
398$a = 12_3; print "$a\n";
399$a = 123_; print "$a\n";
400$a = _+123; print "$a\n";
401$a = +_123; print "$a\n";
402$a = +1_23; print "$a\n";
403$a = +12_3; print "$a\n";
404$a = +123_; print "$a\n";
405$a = _-123; print "$a\n";
406$a = -_123; print "$a\n";
407$a = -1_23; print "$a\n";
408$a = -12_3; print "$a\n";
409$a = -123_; print "$a\n";
410$a = 123._456; print "$a\n";
411$a = 123.4_56; print "$a\n";
412$a = 123.45_6; print "$a\n";
413$a = 123.456_; print "$a\n";
414$a = +123._456; print "$a\n";
415$a = +123.4_56; print "$a\n";
416$a = +123.45_6; print "$a\n";
417$a = +123.456_; print "$a\n";
418$a = -123._456; print "$a\n";
419$a = -123.4_56; print "$a\n";
420$a = -123.45_6; print "$a\n";
421$a = -123.456_; print "$a\n";
422$a = 123.456E_12; print "$a\n";
423$a = 123.456E1_2; print "$a\n";
424$a = 123.456E12_; print "$a\n";
425$a = 123.456E_+12; print "$a\n";
426$a = 123.456E+_12; print "$a\n";
427$a = 123.456E+1_2; print "$a\n";
428$a = 123.456E+12_; print "$a\n";
429$a = 123.456E_-12; print "$a\n";
430$a = 123.456E-_12; print "$a\n";
431$a = 123.456E-1_2; print "$a\n";
432$a = 123.456E-12_; print "$a\n";
b3b48e3e 433$a = 1__23; print "$a\n";
434$a = 12.3__4; print "$a\n";
435$a = 12.34e1__2; print "$a\n";
599cee73 436EXPECT
fbfa96bd 437OPTIONS regex
928753ea 438Misplaced _ in number at - line 6.
928753ea 439Misplaced _ in number at - line 11.
7fd134d9 440Misplaced _ in number at - line 16.
928753ea 441Misplaced _ in number at - line 17.
7fd134d9 442Misplaced _ in number at - line 20.
928753ea 443Misplaced _ in number at - line 21.
7fd134d9 444Misplaced _ in number at - line 24.
445Misplaced _ in number at - line 25.
446Misplaced _ in number at - line 28.
447Misplaced _ in number at - line 29.
448Misplaced _ in number at - line 31.
449Misplaced _ in number at - line 32.
450Misplaced _ in number at - line 33.
451Misplaced _ in number at - line 35.
452Misplaced _ in number at - line 36.
453Misplaced _ in number at - line 37.
454Misplaced _ in number at - line 39.
b3b48e3e 455Misplaced _ in number at - line 40.
456Misplaced _ in number at - line 41.
457Misplaced _ in number at - line 42.
928753ea 458_123
459123
928753ea 460123
7fd134d9 461123
462123
463_123
464123
465123
466123
467-123
468-_123
469-123
470-123
471-123
472123.456
473123.456
474123.456
475123.456
476123.456
477123.456
478123.456
479123.456
480-123.456
481-123.456
482-123.456
483-123.456
484123456000000000
485123456000000000
486123456000000000
487123456000000000
488123456000000000
489123456000000000
490123456000000000
fbfa96bd 4911.23456e-0?10
4921.23456e-0?10
4931.23456e-0?10
4941.23456e-0?10
b3b48e3e 495123
49612.34
49712340000000000
7fd134d9 498_123
499123
500123
501123
502123
503_123
504123
505123
506123
507-123
508-_123
509-123
510-123
511-123
512123.456
513123.456
514123.456
515123.456
516123.456
928753ea 517123.456
518123.456
928753ea 519123.456
7fd134d9 520-123.456
521-123.456
522-123.456
523-123.456
524123456000000000
525123456000000000
526123456000000000
527123456000000000
528123456000000000
529123456000000000
530123456000000000
fbfa96bd 5311.23456e-0?10
5321.23456e-0?10
5331.23456e-0?10
5341.23456e-0?10
b3b48e3e 535123
53612.34
53712340000000000
599cee73 538########
539# toke.c
e476b1b5 540use warnings 'bareword' ;
60e6418e 541#line 25 "bar"
599cee73 542$a = FRED:: ;
e476b1b5 543no warnings 'bareword' ;
0453d815 544#line 25 "bar"
545$a = FRED:: ;
599cee73 546EXPECT
60e6418e 547Bareword "FRED::" refers to nonexistent package at bar line 25.
599cee73 548########
549# toke.c
4438c4b7 550use warnings 'ambiguous' ;
599cee73 551sub time {}
0453d815 552my $a = time() ;
4438c4b7 553no warnings 'ambiguous' ;
0453d815 554my $b = time() ;
599cee73 555EXPECT
556Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4.
557########
558# toke.c
26d16222 559use warnings ;
0453d815 560eval <<'EOE';
df0deb90 561# line 30 "foo"
562warn "yelp";
0453d815 563{
0453d815 564 $_ = " \x{123} " ;
565}
566EOE
567EXPECT
df0deb90 568yelp at foo line 30.
0453d815 569########
570# toke.c
0453d815 571my $a = rand + 4 ;
572EXPECT
573Warning: Use of "rand" without parens is ambiguous at - line 2.
574########
575# toke.c
576$^W = 0 ;
577my $a = rand + 4 ;
578{
4438c4b7 579 no warnings 'ambiguous' ;
0453d815 580 $a = rand + 4 ;
4438c4b7 581 use warnings 'ambiguous' ;
0453d815 582 $a = rand + 4 ;
583}
584$a = rand + 4 ;
585EXPECT
586Warning: Use of "rand" without parens is ambiguous at - line 3.
587Warning: Use of "rand" without parens is ambiguous at - line 8.
588Warning: Use of "rand" without parens is ambiguous at - line 10.
589########
590# toke.c
591sub fred {};
592-fred ;
593EXPECT
594Ambiguous use of -fred resolved as -&fred() at - line 3.
595########
596# toke.c
597$^W = 0 ;
598sub fred {} ;
599-fred ;
600{
4438c4b7 601 no warnings 'ambiguous' ;
0453d815 602 -fred ;
4438c4b7 603 use warnings 'ambiguous' ;
0453d815 604 -fred ;
605}
606-fred ;
607EXPECT
608Ambiguous use of -fred resolved as -&fred() at - line 4.
609Ambiguous use of -fred resolved as -&fred() at - line 9.
610Ambiguous use of -fred resolved as -&fred() at - line 11.
611########
612# toke.c
613open FOO || time;
614EXPECT
615Precedence problem: open FOO should be open(FOO) at - line 2.
616########
617# toke.c
618$^W = 0 ;
619open FOO || time;
620{
e476b1b5 621 no warnings 'precedence' ;
0453d815 622 open FOO || time;
e476b1b5 623 use warnings 'precedence' ;
0453d815 624 open FOO || time;
625}
626open FOO || time;
627EXPECT
628Precedence problem: open FOO should be open(FOO) at - line 3.
629Precedence problem: open FOO should be open(FOO) at - line 8.
630Precedence problem: open FOO should be open(FOO) at - line 10.
631########
632# toke.c
633$^W = 0 ;
634*foo *foo ;
635{
4438c4b7 636 no warnings 'ambiguous' ;
0453d815 637 *foo *foo ;
4438c4b7 638 use warnings 'ambiguous' ;
0453d815 639 *foo *foo ;
640}
641*foo *foo ;
642EXPECT
643Operator or semicolon missing before *foo at - line 3.
644Ambiguous use of * resolved as operator * at - line 3.
645Operator or semicolon missing before *foo at - line 8.
646Ambiguous use of * resolved as operator * at - line 8.
647Operator or semicolon missing before *foo at - line 10.
648Ambiguous use of * resolved as operator * at - line 10.
767a6a26 649########
650# toke.c
e476b1b5 651use warnings 'misc' ;
767a6a26 652my $a = "\m" ;
e476b1b5 653no warnings 'misc' ;
767a6a26 654$a = "\m" ;
655EXPECT
656Unrecognized escape \m passed through at - line 3.
657########
658# toke.c
659use warnings 'portable' ;
660my $a = 0b011111111111111111111111111111110 ;
661 $a = 0b011111111111111111111111111111111 ;
662 $a = 0b111111111111111111111111111111111 ;
663 $a = 0x0fffffffe ;
664 $a = 0x0ffffffff ;
665 $a = 0x1ffffffff ;
666 $a = 0037777777776 ;
667 $a = 0037777777777 ;
668 $a = 0047777777777 ;
669no warnings 'portable' ;
670 $a = 0b011111111111111111111111111111110 ;
671 $a = 0b011111111111111111111111111111111 ;
672 $a = 0b111111111111111111111111111111111 ;
673 $a = 0x0fffffffe ;
674 $a = 0x0ffffffff ;
675 $a = 0x1ffffffff ;
676 $a = 0037777777776 ;
677 $a = 0037777777777 ;
678 $a = 0047777777777 ;
679EXPECT
680Binary number > 0b11111111111111111111111111111111 non-portable at - line 5.
681Hexadecimal number > 0xffffffff non-portable at - line 8.
682Octal number > 037777777777 non-portable at - line 11.
683########
684# toke.c
685use warnings 'overflow' ;
686my $a = 0b011111111111111111111111111111110 ;
687 $a = 0b011111111111111111111111111111111 ;
15041a67 688 $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ;
767a6a26 689 $a = 0x0fffffffe ;
690 $a = 0x0ffffffff ;
15041a67 691 $a = 0x10000000000000000 ;
767a6a26 692 $a = 0037777777776 ;
693 $a = 0037777777777 ;
15041a67 694 $a = 002000000000000000000000;
767a6a26 695no warnings 'overflow' ;
696 $a = 0b011111111111111111111111111111110 ;
697 $a = 0b011111111111111111111111111111111 ;
15041a67 698 $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ;
767a6a26 699 $a = 0x0fffffffe ;
700 $a = 0x0ffffffff ;
15041a67 701 $a = 0x10000000000000000 ;
767a6a26 702 $a = 0037777777776 ;
703 $a = 0037777777777 ;
15041a67 704 $a = 002000000000000000000000;
767a6a26 705EXPECT
706Integer overflow in binary number at - line 5.
707Integer overflow in hexadecimal number at - line 8.
708Integer overflow in octal number at - line 11.
8593bda5 709########
710# toke.c
ac206dc8 711BEGIN { $^C = 1; }
712use warnings 'misc';
713dump;
714CORE::dump;
715EXPECT
716dump() better written as CORE::dump() at - line 4.
717- syntax OK
718########
719# toke.c
720use warnings 'misc';
721use subs qw/dump/;
722sub dump { print "no warning for overriden dump\n"; }
723dump;
724EXPECT
725no warning for overriden dump
726########
727# toke.c
8593bda5 728use warnings 'ambiguous';
729"@mjd_previously_unused_array";
730no warnings 'ambiguous';
731"@mjd_previously_unused_array";
732EXPECT
733Possible unintended interpolation of @mjd_previously_unused_array in string at - line 3.
707afd92 734########
735# toke.c
736# The \q should warn, the \_ should NOT warn.
737use warnings 'misc';
738"foo" =~ /\q/;
739"bar" =~ /\_/;
740no warnings 'misc';
741"foo" =~ /\q/;
742"bar" =~ /\_/;
743EXPECT
744Unrecognized escape \q passed through at - line 4.
4ac733c9 745########
746# toke.c
d8c55666 747# 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com
4ac733c9 748use warnings 'regexp';
749"foo" =~ /foo/c;
64e578a2 750"foo" =~ /foo/cg;
4ac733c9 751no warnings 'regexp';
752"foo" =~ /foo/c;
64e578a2 753"foo" =~ /foo/cg;
4ac733c9 754EXPECT
755Use of /c modifier is meaningless without /g at - line 4.
756########
757# toke.c
d8c55666 758# 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com
4ac733c9 759use warnings 'regexp';
760$_ = "ab" ;
761s/ab/ab/c;
64e578a2 762s/ab/ab/cg;
4ac733c9 763no warnings 'regexp';
764s/ab/ab/c;
64e578a2 765s/ab/ab/cg;
4ac733c9 766EXPECT
64e578a2 767Use of /c modifier is meaningless in s/// at - line 5.
768Use of /c modifier is meaningless in s/// at - line 6.
d8c55666 769########
770-wa
771# toke.c
772# 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings
773print "@F\n";
774EXPECT
775
776########
777-w
778# toke.c
779# 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings
780print "@F\n";
781EXPECT
782Possible unintended interpolation of @F in string at - line 4.
783Name "main::F" used only once: possible typo at - line 4.
784########
785-wa
786# toke.c
787# 20020414 mjd-perl-patch+@plover.com
788EXPECT
789
790