Support Unicode 3.1 names, names without the (XX), and BOM.
[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
0453d815 109 Mandatory Warnings
110 ------------------
111 Use of "%s" without parentheses is ambiguous [check_uni]
112 rand + 4
113
114 Ambiguous use of -%s resolved as -&%s() [yylex]
115 sub fred {} ; - fred ;
116
117 Precedence problem: open %.*s should be open(%.*s) [yylex]
118 open FOO || die;
119
120 Operator or semicolon missing before %c%s [yylex]
121 Ambiguous use of %c resolved as operator %c
122 *foo *foo
123
599cee73 124__END__
125# toke.c
a4f5cc89 126use warnings 'deprecated' ;
599cee73 127format STDOUT =
128@<<< @||| @>>> @>>>
129$a $b "abc" 'def'
130.
4438c4b7 131no warnings 'deprecated' ;
0453d815 132format STDOUT =
133@<<< @||| @>>> @>>>
134$a $b "abc" 'def'
135.
599cee73 136EXPECT
137Use of comma-less variable list is deprecated at - line 5.
138Use of comma-less variable list is deprecated at - line 5.
139Use of comma-less variable list is deprecated at - line 5.
599cee73 140########
141# toke.c
4438c4b7 142use warnings 'deprecated' ;
599cee73 143$a = <<;
144
4438c4b7 145no warnings 'deprecated' ;
0453d815 146$a = <<;
147
599cee73 148EXPECT
149Use of bare << to mean <<"" is deprecated at - line 3.
150########
151# toke.c
4438c4b7 152use warnings 'syntax' ;
599cee73 153s/(abc)/\1/;
4438c4b7 154no warnings 'syntax' ;
0453d815 155s/(abc)/\1/;
599cee73 156EXPECT
157\1 better written as $1 at - line 3.
158########
159# toke.c
4438c4b7 160use warnings 'semicolon' ;
599cee73 161$a = 1
162&time ;
4438c4b7 163no warnings 'semicolon' ;
0453d815 164$a = 1
165&time ;
599cee73 166EXPECT
167Semicolon seems to be missing at - line 3.
168########
169# toke.c
4438c4b7 170use warnings 'syntax' ;
599cee73 171my $a =+ 2 ;
172$a =- 2 ;
173$a =* 2 ;
174$a =% 2 ;
175$a =& 2 ;
176$a =. 2 ;
177$a =^ 2 ;
178$a =| 2 ;
179$a =< 2 ;
180$a =/ 2 ;
181EXPECT
7f01dc7a 182Reversed += operator at - line 3.
183Reversed -= operator at - line 4.
184Reversed *= operator at - line 5.
185Reversed %= operator at - line 6.
186Reversed &= operator at - line 7.
187Reversed .= operator at - line 8.
188Reversed ^= operator at - line 9.
189Reversed |= operator at - line 10.
190Reversed <= operator at - line 11.
191syntax error at - line 8, near "=."
192syntax error at - line 9, near "=^"
193syntax error at - line 10, near "=|"
194Unterminated <> operator at - line 11.
599cee73 195########
196# toke.c
4438c4b7 197no warnings 'syntax' ;
0453d815 198my $a =+ 2 ;
199$a =- 2 ;
200$a =* 2 ;
201$a =% 2 ;
202$a =& 2 ;
203$a =. 2 ;
204$a =^ 2 ;
205$a =| 2 ;
206$a =< 2 ;
207$a =/ 2 ;
208EXPECT
7f01dc7a 209syntax error at - line 8, near "=."
210syntax error at - line 9, near "=^"
211syntax error at - line 10, near "=|"
212Unterminated <> operator at - line 11.
0453d815 213########
214# toke.c
4438c4b7 215use warnings 'syntax' ;
599cee73 216my $a = $a[1,2] ;
4438c4b7 217no warnings 'syntax' ;
0453d815 218my $a = $a[1,2] ;
599cee73 219EXPECT
220Multidimensional syntax $a[1,2] not supported at - line 3.
221########
222# toke.c
4438c4b7 223use warnings 'syntax' ;
599cee73 224sub fred {} ; $SIG{TERM} = fred;
4438c4b7 225no warnings 'syntax' ;
0453d815 226$SIG{TERM} = fred;
599cee73 227EXPECT
228You need to quote "fred" at - line 3.
229########
230# toke.c
4438c4b7 231use warnings 'syntax' ;
599cee73 232@a[3] = 2;
233@a{3} = 2;
4438c4b7 234no warnings 'syntax' ;
0453d815 235@a[3] = 2;
236@a{3} = 2;
599cee73 237EXPECT
238Scalar value @a[3] better written as $a[3] at - line 3.
239Scalar value @a{3} better written as $a{3} at - line 4.
240########
241# toke.c
4438c4b7 242use warnings 'syntax' ;
599cee73 243$_ = "ab" ;
244s/(ab)/\1/e;
4438c4b7 245no warnings 'syntax' ;
0453d815 246$_ = "ab" ;
247s/(ab)/\1/e;
599cee73 248EXPECT
249Can't use \1 to mean $1 in expression at - line 4.
250########
251# toke.c
4438c4b7 252use warnings 'reserved' ;
599cee73 253$a = abc;
1c3923b3 254$a = { def
255
256=> 1 };
4438c4b7 257no warnings 'reserved' ;
0453d815 258$a = abc;
599cee73 259EXPECT
260Unquoted string "abc" may clash with future reserved word at - line 3.
261########
262# toke.c
e476b1b5 263use warnings 'qw' ;
599cee73 264@a = qw(a, b, c) ;
e476b1b5 265no warnings 'qw' ;
0453d815 266@a = qw(a, b, c) ;
599cee73 267EXPECT
268Possible attempt to separate words with commas at - line 3.
269########
270# toke.c
e476b1b5 271use warnings 'qw' ;
599cee73 272@a = qw(a b #) ;
e476b1b5 273no warnings 'qw' ;
0453d815 274@a = qw(a b #) ;
599cee73 275EXPECT
276Possible attempt to put comments in qw() list at - line 3.
277########
278# toke.c
4438c4b7 279use warnings 'syntax' ;
599cee73 280print ("")
281EXPECT
282print (...) interpreted as function at - line 3.
283########
284# toke.c
4438c4b7 285no warnings 'syntax' ;
0453d815 286print ("")
287EXPECT
288
289########
290# toke.c
4438c4b7 291use warnings 'syntax' ;
599cee73 292printf ("")
293EXPECT
294printf (...) interpreted as function at - line 3.
295########
296# toke.c
4438c4b7 297no warnings 'syntax' ;
0453d815 298printf ("")
299EXPECT
300
301########
302# toke.c
4438c4b7 303use warnings 'syntax' ;
599cee73 304sort ("")
305EXPECT
306sort (...) interpreted as function at - line 3.
307########
308# toke.c
4438c4b7 309no warnings 'syntax' ;
0453d815 310sort ("")
311EXPECT
312
313########
314# toke.c
4438c4b7 315use warnings 'ambiguous' ;
599cee73 316$a = ${time[2]};
4438c4b7 317no warnings 'ambiguous' ;
0453d815 318$a = ${time[2]};
599cee73 319EXPECT
320Ambiguous use of ${time[...]} resolved to $time[...] at - line 3.
321########
322# toke.c
4438c4b7 323use warnings 'ambiguous' ;
599cee73 324$a = ${time{2}};
325EXPECT
326Ambiguous use of ${time{...}} resolved to $time{...} at - line 3.
327########
328# toke.c
4438c4b7 329no warnings 'ambiguous' ;
0453d815 330$a = ${time{2}};
331EXPECT
332
333########
334# toke.c
4438c4b7 335use warnings 'ambiguous' ;
599cee73 336$a = ${time} ;
4438c4b7 337no warnings 'ambiguous' ;
0453d815 338$a = ${time} ;
599cee73 339EXPECT
340Ambiguous use of ${time} resolved to $time at - line 3.
341########
342# toke.c
4438c4b7 343use warnings 'ambiguous' ;
599cee73 344sub fred {}
345$a = ${fred} ;
4438c4b7 346no warnings 'ambiguous' ;
0453d815 347$a = ${fred} ;
599cee73 348EXPECT
349Ambiguous use of ${fred} resolved to $fred at - line 4.
350########
351# toke.c
4438c4b7 352use warnings 'syntax' ;
7fd134d9 353$a = _123; print "$a\n"; #( 3 string)
354$a = 1_23; print "$a\n";
355$a = 12_3; print "$a\n";
356$a = 123_; print "$a\n"; # 6
357$a = _+123; print "$a\n"; # 7 string)
358$a = +_123; print "$a\n"; #( 8 string)
359$a = +1_23; print "$a\n";
360$a = +12_3; print "$a\n";
361$a = +123_; print "$a\n"; # 11
362$a = _-123; print "$a\n"; #(12 string)
363$a = -_123; print "$a\n"; #(13 string)
364$a = -1_23; print "$a\n";
365$a = -12_3; print "$a\n";
366$a = -123_; print "$a\n"; # 16
367$a = 123._456; print "$a\n"; # 17
368$a = 123.4_56; print "$a\n";
369$a = 123.45_6; print "$a\n";
370$a = 123.456_; print "$a\n"; # 20
371$a = +123._456; print "$a\n"; # 21
372$a = +123.4_56; print "$a\n";
373$a = +123.45_6; print "$a\n";
374$a = +123.456_; print "$a\n"; # 24
375$a = -123._456; print "$a\n"; # 25
376$a = -123.4_56; print "$a\n";
377$a = -123.45_6; print "$a\n";
378$a = -123.456_; print "$a\n"; # 28
379$a = 123.456E_12; print "$a\n"; # 29
380$a = 123.456E1_2; print "$a\n";
381$a = 123.456E12_; print "$a\n"; # 31
382$a = 123.456E_+12; print "$a\n"; # 32
383$a = 123.456E+_12; print "$a\n"; # 33
384$a = 123.456E+1_2; print "$a\n";
385$a = 123.456E+12_; print "$a\n"; # 35
386$a = 123.456E_-12; print "$a\n"; # 36
387$a = 123.456E-_12; print "$a\n"; # 37
388$a = 123.456E-1_2; print "$a\n";
389$a = 123.456E-12_; print "$a\n"; # 39
b3b48e3e 390$a = 1__23; print "$a\n"; # 40
391$a = 12.3__4; print "$a\n"; # 41
392$a = 12.34e1__2; print "$a\n"; # 42
4438c4b7 393no warnings 'syntax' ;
7fd134d9 394$a = _123; print "$a\n";
395$a = 1_23; print "$a\n";
396$a = 12_3; print "$a\n";
397$a = 123_; print "$a\n";
398$a = _+123; print "$a\n";
399$a = +_123; print "$a\n";
400$a = +1_23; print "$a\n";
401$a = +12_3; print "$a\n";
402$a = +123_; print "$a\n";
403$a = _-123; print "$a\n";
404$a = -_123; print "$a\n";
405$a = -1_23; print "$a\n";
406$a = -12_3; print "$a\n";
407$a = -123_; print "$a\n";
408$a = 123._456; print "$a\n";
409$a = 123.4_56; print "$a\n";
410$a = 123.45_6; print "$a\n";
411$a = 123.456_; print "$a\n";
412$a = +123._456; print "$a\n";
413$a = +123.4_56; print "$a\n";
414$a = +123.45_6; print "$a\n";
415$a = +123.456_; print "$a\n";
416$a = -123._456; print "$a\n";
417$a = -123.4_56; print "$a\n";
418$a = -123.45_6; print "$a\n";
419$a = -123.456_; print "$a\n";
420$a = 123.456E_12; print "$a\n";
421$a = 123.456E1_2; print "$a\n";
422$a = 123.456E12_; print "$a\n";
423$a = 123.456E_+12; print "$a\n";
424$a = 123.456E+_12; print "$a\n";
425$a = 123.456E+1_2; print "$a\n";
426$a = 123.456E+12_; print "$a\n";
427$a = 123.456E_-12; print "$a\n";
428$a = 123.456E-_12; print "$a\n";
429$a = 123.456E-1_2; print "$a\n";
430$a = 123.456E-12_; print "$a\n";
b3b48e3e 431$a = 1__23; print "$a\n";
432$a = 12.3__4; print "$a\n";
433$a = 12.34e1__2; print "$a\n";
599cee73 434EXPECT
fbfa96bd 435OPTIONS regex
928753ea 436Misplaced _ in number at - line 6.
928753ea 437Misplaced _ in number at - line 11.
7fd134d9 438Misplaced _ in number at - line 16.
928753ea 439Misplaced _ in number at - line 17.
7fd134d9 440Misplaced _ in number at - line 20.
928753ea 441Misplaced _ in number at - line 21.
7fd134d9 442Misplaced _ in number at - line 24.
443Misplaced _ in number at - line 25.
444Misplaced _ in number at - line 28.
445Misplaced _ in number at - line 29.
446Misplaced _ in number at - line 31.
447Misplaced _ in number at - line 32.
448Misplaced _ in number at - line 33.
449Misplaced _ in number at - line 35.
450Misplaced _ in number at - line 36.
451Misplaced _ in number at - line 37.
452Misplaced _ in number at - line 39.
b3b48e3e 453Misplaced _ in number at - line 40.
454Misplaced _ in number at - line 41.
455Misplaced _ in number at - line 42.
928753ea 456_123
457123
928753ea 458123
7fd134d9 459123
460123
461_123
462123
463123
464123
465-123
466-_123
467-123
468-123
469-123
470123.456
471123.456
472123.456
473123.456
474123.456
475123.456
476123.456
477123.456
478-123.456
479-123.456
480-123.456
481-123.456
482123456000000000
483123456000000000
484123456000000000
485123456000000000
486123456000000000
487123456000000000
488123456000000000
fbfa96bd 4891.23456e-0?10
4901.23456e-0?10
4911.23456e-0?10
4921.23456e-0?10
b3b48e3e 493123
49412.34
49512340000000000
7fd134d9 496_123
497123
498123
499123
500123
501_123
502123
503123
504123
505-123
506-_123
507-123
508-123
509-123
510123.456
511123.456
512123.456
513123.456
514123.456
928753ea 515123.456
516123.456
928753ea 517123.456
7fd134d9 518-123.456
519-123.456
520-123.456
521-123.456
522123456000000000
523123456000000000
524123456000000000
525123456000000000
526123456000000000
527123456000000000
528123456000000000
fbfa96bd 5291.23456e-0?10
5301.23456e-0?10
5311.23456e-0?10
5321.23456e-0?10
b3b48e3e 533123
53412.34
53512340000000000
599cee73 536########
537# toke.c
e476b1b5 538use warnings 'bareword' ;
60e6418e 539#line 25 "bar"
599cee73 540$a = FRED:: ;
e476b1b5 541no warnings 'bareword' ;
0453d815 542#line 25 "bar"
543$a = FRED:: ;
599cee73 544EXPECT
60e6418e 545Bareword "FRED::" refers to nonexistent package at bar line 25.
599cee73 546########
547# toke.c
4438c4b7 548use warnings 'ambiguous' ;
599cee73 549sub time {}
0453d815 550my $a = time() ;
4438c4b7 551no warnings 'ambiguous' ;
0453d815 552my $b = time() ;
599cee73 553EXPECT
554Ambiguous call resolved as CORE::time(), qualify as such or use & at - line 4.
555########
556# toke.c
26d16222 557use warnings ;
0453d815 558eval <<'EOE';
df0deb90 559# line 30 "foo"
560warn "yelp";
0453d815 561{
0453d815 562 $_ = " \x{123} " ;
563}
564EOE
565EXPECT
df0deb90 566yelp at foo line 30.
0453d815 567########
568# toke.c
0453d815 569my $a = rand + 4 ;
570EXPECT
571Warning: Use of "rand" without parens is ambiguous at - line 2.
572########
573# toke.c
574$^W = 0 ;
575my $a = rand + 4 ;
576{
4438c4b7 577 no warnings 'ambiguous' ;
0453d815 578 $a = rand + 4 ;
4438c4b7 579 use warnings 'ambiguous' ;
0453d815 580 $a = rand + 4 ;
581}
582$a = rand + 4 ;
583EXPECT
584Warning: Use of "rand" without parens is ambiguous at - line 3.
585Warning: Use of "rand" without parens is ambiguous at - line 8.
586Warning: Use of "rand" without parens is ambiguous at - line 10.
587########
588# toke.c
589sub fred {};
590-fred ;
591EXPECT
592Ambiguous use of -fred resolved as -&fred() at - line 3.
593########
594# toke.c
595$^W = 0 ;
596sub fred {} ;
597-fred ;
598{
4438c4b7 599 no warnings 'ambiguous' ;
0453d815 600 -fred ;
4438c4b7 601 use warnings 'ambiguous' ;
0453d815 602 -fred ;
603}
604-fred ;
605EXPECT
606Ambiguous use of -fred resolved as -&fred() at - line 4.
607Ambiguous use of -fred resolved as -&fred() at - line 9.
608Ambiguous use of -fred resolved as -&fred() at - line 11.
609########
610# toke.c
611open FOO || time;
612EXPECT
613Precedence problem: open FOO should be open(FOO) at - line 2.
614########
615# toke.c
616$^W = 0 ;
617open FOO || time;
618{
e476b1b5 619 no warnings 'precedence' ;
0453d815 620 open FOO || time;
e476b1b5 621 use warnings 'precedence' ;
0453d815 622 open FOO || time;
623}
624open FOO || time;
625EXPECT
626Precedence problem: open FOO should be open(FOO) at - line 3.
627Precedence problem: open FOO should be open(FOO) at - line 8.
628Precedence problem: open FOO should be open(FOO) at - line 10.
629########
630# toke.c
631$^W = 0 ;
632*foo *foo ;
633{
4438c4b7 634 no warnings 'ambiguous' ;
0453d815 635 *foo *foo ;
4438c4b7 636 use warnings 'ambiguous' ;
0453d815 637 *foo *foo ;
638}
639*foo *foo ;
640EXPECT
641Operator or semicolon missing before *foo at - line 3.
642Ambiguous use of * resolved as operator * at - line 3.
643Operator or semicolon missing before *foo at - line 8.
644Ambiguous use of * resolved as operator * at - line 8.
645Operator or semicolon missing before *foo at - line 10.
646Ambiguous use of * resolved as operator * at - line 10.
767a6a26 647########
648# toke.c
e476b1b5 649use warnings 'misc' ;
767a6a26 650my $a = "\m" ;
e476b1b5 651no warnings 'misc' ;
767a6a26 652$a = "\m" ;
653EXPECT
654Unrecognized escape \m passed through at - line 3.
655########
656# toke.c
657use warnings 'portable' ;
658my $a = 0b011111111111111111111111111111110 ;
659 $a = 0b011111111111111111111111111111111 ;
660 $a = 0b111111111111111111111111111111111 ;
661 $a = 0x0fffffffe ;
662 $a = 0x0ffffffff ;
663 $a = 0x1ffffffff ;
664 $a = 0037777777776 ;
665 $a = 0037777777777 ;
666 $a = 0047777777777 ;
667no warnings 'portable' ;
668 $a = 0b011111111111111111111111111111110 ;
669 $a = 0b011111111111111111111111111111111 ;
670 $a = 0b111111111111111111111111111111111 ;
671 $a = 0x0fffffffe ;
672 $a = 0x0ffffffff ;
673 $a = 0x1ffffffff ;
674 $a = 0037777777776 ;
675 $a = 0037777777777 ;
676 $a = 0047777777777 ;
677EXPECT
678Binary number > 0b11111111111111111111111111111111 non-portable at - line 5.
679Hexadecimal number > 0xffffffff non-portable at - line 8.
680Octal number > 037777777777 non-portable at - line 11.
681########
682# toke.c
683use warnings 'overflow' ;
684my $a = 0b011111111111111111111111111111110 ;
685 $a = 0b011111111111111111111111111111111 ;
15041a67 686 $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ;
767a6a26 687 $a = 0x0fffffffe ;
688 $a = 0x0ffffffff ;
15041a67 689 $a = 0x10000000000000000 ;
767a6a26 690 $a = 0037777777776 ;
691 $a = 0037777777777 ;
15041a67 692 $a = 002000000000000000000000;
767a6a26 693no warnings 'overflow' ;
694 $a = 0b011111111111111111111111111111110 ;
695 $a = 0b011111111111111111111111111111111 ;
15041a67 696 $a = 0b10000000000000000000000000000000000000000000000000000000000000000 ;
767a6a26 697 $a = 0x0fffffffe ;
698 $a = 0x0ffffffff ;
15041a67 699 $a = 0x10000000000000000 ;
767a6a26 700 $a = 0037777777776 ;
701 $a = 0037777777777 ;
15041a67 702 $a = 002000000000000000000000;
767a6a26 703EXPECT
704Integer overflow in binary number at - line 5.
705Integer overflow in hexadecimal number at - line 8.
706Integer overflow in octal number at - line 11.
8593bda5 707########
708# toke.c
ac206dc8 709BEGIN { $^C = 1; }
710use warnings 'misc';
711dump;
712CORE::dump;
713EXPECT
714dump() better written as CORE::dump() at - line 4.
715- syntax OK
716########
717# toke.c
718use warnings 'misc';
719use subs qw/dump/;
720sub dump { print "no warning for overriden dump\n"; }
721dump;
722EXPECT
723no warning for overriden dump
724########
725# toke.c
8593bda5 726use warnings 'ambiguous';
727"@mjd_previously_unused_array";
728no warnings 'ambiguous';
729"@mjd_previously_unused_array";
730EXPECT
731Possible unintended interpolation of @mjd_previously_unused_array in string at - line 3.
707afd92 732########
733# toke.c
734# The \q should warn, the \_ should NOT warn.
735use warnings 'misc';
736"foo" =~ /\q/;
737"bar" =~ /\_/;
738no warnings 'misc';
739"foo" =~ /\q/;
740"bar" =~ /\_/;
741EXPECT
742Unrecognized escape \q passed through at - line 4.
4ac733c9 743########
744# toke.c
745# 20020328 mjd@plover.com at behest of jfriedl@yahoo.com
746use warnings 'regexp';
747"foo" =~ /foo/c;
748no warnings 'regexp';
749"foo" =~ /foo/c;
750EXPECT
751Use of /c modifier is meaningless without /g at - line 4.
752########
753# toke.c
754# 20020328 mjd@plover.com at behest of jfriedl@yahoo.com
755use warnings 'regexp';
756$_ = "ab" ;
757s/ab/ab/c;
758no warnings 'regexp';
759s/ab/ab/c;
760EXPECT
761Use of /c modifier is meaningless without /g at - line 5.