xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/t/lib/warnings/toke (revision 0:68f95e015346)
1*0Sstevel@tonic-gatetoke.c	AOK
2*0Sstevel@tonic-gate
3*0Sstevel@tonic-gate    we seem to have lost a few ambiguous warnings!!
4*0Sstevel@tonic-gate
5*0Sstevel@tonic-gate
6*0Sstevel@tonic-gate 		$a = <<;
7*0Sstevel@tonic-gate 		Use of comma-less variable list is deprecated
8*0Sstevel@tonic-gate		(called 3 times via depcom)
9*0Sstevel@tonic-gate
10*0Sstevel@tonic-gate     \1 better written as $1
11*0Sstevel@tonic-gate 	use warnings 'syntax' ;
12*0Sstevel@tonic-gate 	s/(abc)/\1/;
13*0Sstevel@tonic-gate
14*0Sstevel@tonic-gate     warn(warn_nosemi)
15*0Sstevel@tonic-gate     Semicolon seems to be missing
16*0Sstevel@tonic-gate	$a = 1
17*0Sstevel@tonic-gate	&time ;
18*0Sstevel@tonic-gate
19*0Sstevel@tonic-gate
20*0Sstevel@tonic-gate     Reversed %c= operator
21*0Sstevel@tonic-gate	my $a =+ 2 ;
22*0Sstevel@tonic-gate	$a =- 2 ;
23*0Sstevel@tonic-gate	$a =* 2 ;
24*0Sstevel@tonic-gate	$a =% 2 ;
25*0Sstevel@tonic-gate	$a =& 2 ;
26*0Sstevel@tonic-gate	$a =. 2 ;
27*0Sstevel@tonic-gate	$a =^ 2 ;
28*0Sstevel@tonic-gate	$a =| 2 ;
29*0Sstevel@tonic-gate	$a =< 2 ;
30*0Sstevel@tonic-gate	$a =/ 2 ;
31*0Sstevel@tonic-gate
32*0Sstevel@tonic-gate     Multidimensional syntax %.*s not supported
33*0Sstevel@tonic-gate	my $a = $a[1,2] ;
34*0Sstevel@tonic-gate
35*0Sstevel@tonic-gate     You need to quote \"%s\""
36*0Sstevel@tonic-gate	sub fred {} ; $SIG{TERM} = fred;
37*0Sstevel@tonic-gate
38*0Sstevel@tonic-gate     Scalar value %.*s better written as $%.*s"
39*0Sstevel@tonic-gate	@a[3] = 2;
40*0Sstevel@tonic-gate	@a{3} = 2;
41*0Sstevel@tonic-gate
42*0Sstevel@tonic-gate     Can't use \\%c to mean $%c in expression
43*0Sstevel@tonic-gate	$_ = "ab" ; s/(ab)/\1/e;
44*0Sstevel@tonic-gate
45*0Sstevel@tonic-gate     Unquoted string "abc" may clash with future reserved word at - line 3.
46*0Sstevel@tonic-gate     warn(warn_reserved
47*0Sstevel@tonic-gate	$a = abc;
48*0Sstevel@tonic-gate
49*0Sstevel@tonic-gate     Possible attempt to separate words with commas
50*0Sstevel@tonic-gate	@a = qw(a, b, c) ;
51*0Sstevel@tonic-gate
52*0Sstevel@tonic-gate     Possible attempt to put comments in qw() list
53*0Sstevel@tonic-gate	@a = qw(a b # c) ;
54*0Sstevel@tonic-gate
55*0Sstevel@tonic-gate     %s (...) interpreted as function
56*0Sstevel@tonic-gate	print ("")
57*0Sstevel@tonic-gate	printf ("")
58*0Sstevel@tonic-gate	sort ("")
59*0Sstevel@tonic-gate
60*0Sstevel@tonic-gate     Ambiguous use of %c{%s%s} resolved to %c%s%s
61*0Sstevel@tonic-gate	$a = ${time[2]}
62*0Sstevel@tonic-gate	$a = ${time{2}}
63*0Sstevel@tonic-gate
64*0Sstevel@tonic-gate
65*0Sstevel@tonic-gate     Ambiguous use of %c{%s} resolved to %c%s
66*0Sstevel@tonic-gate	$a = ${time}
67*0Sstevel@tonic-gate	sub fred {} $a = ${fred}
68*0Sstevel@tonic-gate
69*0Sstevel@tonic-gate     Misplaced _ in number
70*0Sstevel@tonic-gate	$a = 1_2;
71*0Sstevel@tonic-gate	$a = 1_2345_6;
72*0Sstevel@tonic-gate
73*0Sstevel@tonic-gate    Bareword \"%s\" refers to nonexistent package
74*0Sstevel@tonic-gate	$a = FRED:: ;
75*0Sstevel@tonic-gate
76*0Sstevel@tonic-gate    Ambiguous call resolved as CORE::%s(), qualify as such or use &
77*0Sstevel@tonic-gate	sub time {}
78*0Sstevel@tonic-gate	my $a = time()
79*0Sstevel@tonic-gate
80*0Sstevel@tonic-gate    Unrecognized escape \\%c passed through
81*0Sstevel@tonic-gate        $a = "\m" ;
82*0Sstevel@tonic-gate
83*0Sstevel@tonic-gate    %s number > %s non-portable
84*0Sstevel@tonic-gate        my $a =  0b011111111111111111111111111111110 ;
85*0Sstevel@tonic-gate        $a =  0b011111111111111111111111111111111 ;
86*0Sstevel@tonic-gate        $a =  0b111111111111111111111111111111111 ;
87*0Sstevel@tonic-gate        $a =  0x0fffffffe ;
88*0Sstevel@tonic-gate        $a =  0x0ffffffff ;
89*0Sstevel@tonic-gate        $a =  0x1ffffffff ;
90*0Sstevel@tonic-gate        $a =  0037777777776 ;
91*0Sstevel@tonic-gate        $a =  0037777777777 ;
92*0Sstevel@tonic-gate        $a =  0047777777777 ;
93*0Sstevel@tonic-gate
94*0Sstevel@tonic-gate    Integer overflow in binary number
95*0Sstevel@tonic-gate        my $a =  0b011111111111111111111111111111110 ;
96*0Sstevel@tonic-gate        $a =  0b011111111111111111111111111111111 ;
97*0Sstevel@tonic-gate        $a =  0b111111111111111111111111111111111 ;
98*0Sstevel@tonic-gate        $a =  0x0fffffffe ;
99*0Sstevel@tonic-gate        $a =  0x0ffffffff ;
100*0Sstevel@tonic-gate        $a =  0x1ffffffff ;
101*0Sstevel@tonic-gate        $a =  0037777777776 ;
102*0Sstevel@tonic-gate        $a =  0037777777777 ;
103*0Sstevel@tonic-gate        $a =  0047777777777 ;
104*0Sstevel@tonic-gate
105*0Sstevel@tonic-gate    dump() better written as CORE::dump()
106*0Sstevel@tonic-gate
107*0Sstevel@tonic-gate    Use of /c modifier is meaningless without /g
108*0Sstevel@tonic-gate
109*0Sstevel@tonic-gate    Use of /c modifier is meaningless in s///
110*0Sstevel@tonic-gate
111*0Sstevel@tonic-gate    Mandatory Warnings
112*0Sstevel@tonic-gate    ------------------
113*0Sstevel@tonic-gate    Use of "%s" without parentheses is ambiguous	[check_uni]
114*0Sstevel@tonic-gate        rand + 4
115*0Sstevel@tonic-gate
116*0Sstevel@tonic-gate    Ambiguous use of -%s resolved as -&%s() 		[yylex]
117*0Sstevel@tonic-gate        sub fred {} ; - fred ;
118*0Sstevel@tonic-gate
119*0Sstevel@tonic-gate    Precedence problem: open %.*s should be open(%.*s)	[yylex]
120*0Sstevel@tonic-gate    	open FOO || die;
121*0Sstevel@tonic-gate
122*0Sstevel@tonic-gate    Operator or semicolon missing before %c%s		[yylex]
123*0Sstevel@tonic-gate    Ambiguous use of %c resolved as operator %c
124*0Sstevel@tonic-gate        *foo *foo
125*0Sstevel@tonic-gate
126*0Sstevel@tonic-gate__END__
127*0Sstevel@tonic-gate# toke.c
128*0Sstevel@tonic-gateuse warnings 'deprecated' ;
129*0Sstevel@tonic-gateformat STDOUT =
130*0Sstevel@tonic-gate@<<<  @|||  @>>>  @>>>
131*0Sstevel@tonic-gate$a    $b    "abc" 'def'
132*0Sstevel@tonic-gate.
133*0Sstevel@tonic-gateno warnings 'deprecated' ;
134*0Sstevel@tonic-gateformat STDOUT =
135*0Sstevel@tonic-gate@<<<  @|||  @>>>  @>>>
136*0Sstevel@tonic-gate$a    $b    "abc" 'def'
137*0Sstevel@tonic-gate.
138*0Sstevel@tonic-gateEXPECT
139*0Sstevel@tonic-gateUse of comma-less variable list is deprecated at - line 5.
140*0Sstevel@tonic-gateUse of comma-less variable list is deprecated at - line 5.
141*0Sstevel@tonic-gateUse of comma-less variable list is deprecated at - line 5.
142*0Sstevel@tonic-gate########
143*0Sstevel@tonic-gate# toke.c
144*0Sstevel@tonic-gateuse warnings 'deprecated' ;
145*0Sstevel@tonic-gate$a = <<;
146*0Sstevel@tonic-gate
147*0Sstevel@tonic-gateno warnings 'deprecated' ;
148*0Sstevel@tonic-gate$a = <<;
149*0Sstevel@tonic-gate
150*0Sstevel@tonic-gateEXPECT
151*0Sstevel@tonic-gateUse of bare << to mean <<"" is deprecated at - line 3.
152*0Sstevel@tonic-gate########
153*0Sstevel@tonic-gate# toke.c
154*0Sstevel@tonic-gateuse warnings 'syntax' ;
155*0Sstevel@tonic-gates/(abc)/\1/;
156*0Sstevel@tonic-gateno warnings 'syntax' ;
157*0Sstevel@tonic-gates/(abc)/\1/;
158*0Sstevel@tonic-gateEXPECT
159*0Sstevel@tonic-gate\1 better written as $1 at - line 3.
160*0Sstevel@tonic-gate########
161*0Sstevel@tonic-gate# toke.c
162*0Sstevel@tonic-gateuse warnings 'semicolon' ;
163*0Sstevel@tonic-gate$a = 1
164*0Sstevel@tonic-gate&time ;
165*0Sstevel@tonic-gateno warnings 'semicolon' ;
166*0Sstevel@tonic-gate$a = 1
167*0Sstevel@tonic-gate&time ;
168*0Sstevel@tonic-gateEXPECT
169*0Sstevel@tonic-gateSemicolon seems to be missing at - line 3.
170*0Sstevel@tonic-gate########
171*0Sstevel@tonic-gate# toke.c
172*0Sstevel@tonic-gateuse warnings 'syntax' ;
173*0Sstevel@tonic-gatemy $a =+ 2 ;
174*0Sstevel@tonic-gate$a =- 2 ;
175*0Sstevel@tonic-gate$a =* 2 ;
176*0Sstevel@tonic-gate$a =% 2 ;
177*0Sstevel@tonic-gate$a =& 2 ;
178*0Sstevel@tonic-gate$a =. 2 ;
179*0Sstevel@tonic-gate$a =^ 2 ;
180*0Sstevel@tonic-gate$a =| 2 ;
181*0Sstevel@tonic-gate$a =< 2 ;
182*0Sstevel@tonic-gate$a =/ 2 ;
183*0Sstevel@tonic-gateEXPECT
184*0Sstevel@tonic-gateReversed += operator at - line 3.
185*0Sstevel@tonic-gateReversed -= operator at - line 4.
186*0Sstevel@tonic-gateReversed *= operator at - line 5.
187*0Sstevel@tonic-gateReversed %= operator at - line 6.
188*0Sstevel@tonic-gateReversed &= operator at - line 7.
189*0Sstevel@tonic-gateReversed .= operator at - line 8.
190*0Sstevel@tonic-gateReversed ^= operator at - line 9.
191*0Sstevel@tonic-gateReversed |= operator at - line 10.
192*0Sstevel@tonic-gateReversed <= operator at - line 11.
193*0Sstevel@tonic-gatesyntax error at - line 8, near "=."
194*0Sstevel@tonic-gatesyntax error at - line 9, near "=^"
195*0Sstevel@tonic-gatesyntax error at - line 10, near "=|"
196*0Sstevel@tonic-gateUnterminated <> operator at - line 11.
197*0Sstevel@tonic-gate########
198*0Sstevel@tonic-gate# toke.c
199*0Sstevel@tonic-gateno warnings 'syntax' ;
200*0Sstevel@tonic-gatemy $a =+ 2 ;
201*0Sstevel@tonic-gate$a =- 2 ;
202*0Sstevel@tonic-gate$a =* 2 ;
203*0Sstevel@tonic-gate$a =% 2 ;
204*0Sstevel@tonic-gate$a =& 2 ;
205*0Sstevel@tonic-gate$a =. 2 ;
206*0Sstevel@tonic-gate$a =^ 2 ;
207*0Sstevel@tonic-gate$a =| 2 ;
208*0Sstevel@tonic-gate$a =< 2 ;
209*0Sstevel@tonic-gate$a =/ 2 ;
210*0Sstevel@tonic-gateEXPECT
211*0Sstevel@tonic-gatesyntax error at - line 8, near "=."
212*0Sstevel@tonic-gatesyntax error at - line 9, near "=^"
213*0Sstevel@tonic-gatesyntax error at - line 10, near "=|"
214*0Sstevel@tonic-gateUnterminated <> operator at - line 11.
215*0Sstevel@tonic-gate########
216*0Sstevel@tonic-gate# toke.c
217*0Sstevel@tonic-gateuse warnings 'syntax' ;
218*0Sstevel@tonic-gatemy $a = $a[1,2] ;
219*0Sstevel@tonic-gateno warnings 'syntax' ;
220*0Sstevel@tonic-gatemy $a = $a[1,2] ;
221*0Sstevel@tonic-gateEXPECT
222*0Sstevel@tonic-gateMultidimensional syntax $a[1,2] not supported at - line 3.
223*0Sstevel@tonic-gate########
224*0Sstevel@tonic-gate# toke.c
225*0Sstevel@tonic-gateuse warnings 'syntax' ;
226*0Sstevel@tonic-gatesub fred {} ; $SIG{TERM} = fred;
227*0Sstevel@tonic-gateno warnings 'syntax' ;
228*0Sstevel@tonic-gate$SIG{TERM} = fred;
229*0Sstevel@tonic-gateEXPECT
230*0Sstevel@tonic-gateYou need to quote "fred" at - line 3.
231*0Sstevel@tonic-gate########
232*0Sstevel@tonic-gate# toke.c
233*0Sstevel@tonic-gateuse warnings 'syntax' ;
234*0Sstevel@tonic-gate@a[3] = 2;
235*0Sstevel@tonic-gate@a{3} = 2;
236*0Sstevel@tonic-gateno warnings 'syntax' ;
237*0Sstevel@tonic-gate@a[3] = 2;
238*0Sstevel@tonic-gate@a{3} = 2;
239*0Sstevel@tonic-gateEXPECT
240*0Sstevel@tonic-gateScalar value @a[3] better written as $a[3] at - line 3.
241*0Sstevel@tonic-gateScalar value @a{3} better written as $a{3} at - line 4.
242*0Sstevel@tonic-gate########
243*0Sstevel@tonic-gate# toke.c
244*0Sstevel@tonic-gateuse warnings 'syntax' ;
245*0Sstevel@tonic-gate$_ = "ab" ;
246*0Sstevel@tonic-gates/(ab)/\1/e;
247*0Sstevel@tonic-gateno warnings 'syntax' ;
248*0Sstevel@tonic-gate$_ = "ab" ;
249*0Sstevel@tonic-gates/(ab)/\1/e;
250*0Sstevel@tonic-gateEXPECT
251*0Sstevel@tonic-gateCan't use \1 to mean $1 in expression at - line 4.
252*0Sstevel@tonic-gate########
253*0Sstevel@tonic-gate# toke.c
254*0Sstevel@tonic-gateuse warnings 'reserved' ;
255*0Sstevel@tonic-gate$a = abc;
256*0Sstevel@tonic-gate$a = { def
257*0Sstevel@tonic-gate
258*0Sstevel@tonic-gate=> 1 };
259*0Sstevel@tonic-gateno warnings 'reserved' ;
260*0Sstevel@tonic-gate$a = abc;
261*0Sstevel@tonic-gateEXPECT
262*0Sstevel@tonic-gateUnquoted string "abc" may clash with future reserved word at - line 3.
263*0Sstevel@tonic-gate########
264*0Sstevel@tonic-gate# toke.c
265*0Sstevel@tonic-gateuse warnings 'qw' ;
266*0Sstevel@tonic-gate@a = qw(a, b, c) ;
267*0Sstevel@tonic-gateno warnings 'qw' ;
268*0Sstevel@tonic-gate@a = qw(a, b, c) ;
269*0Sstevel@tonic-gateEXPECT
270*0Sstevel@tonic-gatePossible attempt to separate words with commas at - line 3.
271*0Sstevel@tonic-gate########
272*0Sstevel@tonic-gate# toke.c
273*0Sstevel@tonic-gateuse warnings 'qw' ;
274*0Sstevel@tonic-gate@a = qw(a b #) ;
275*0Sstevel@tonic-gateno warnings 'qw' ;
276*0Sstevel@tonic-gate@a = qw(a b #) ;
277*0Sstevel@tonic-gateEXPECT
278*0Sstevel@tonic-gatePossible attempt to put comments in qw() list at - line 3.
279*0Sstevel@tonic-gate########
280*0Sstevel@tonic-gate# toke.c
281*0Sstevel@tonic-gateuse warnings 'syntax' ;
282*0Sstevel@tonic-gateprint ("")
283*0Sstevel@tonic-gateEXPECT
284*0Sstevel@tonic-gateprint (...) interpreted as function at - line 3.
285*0Sstevel@tonic-gate########
286*0Sstevel@tonic-gate# toke.c
287*0Sstevel@tonic-gateno warnings 'syntax' ;
288*0Sstevel@tonic-gateprint ("")
289*0Sstevel@tonic-gateEXPECT
290*0Sstevel@tonic-gate
291*0Sstevel@tonic-gate########
292*0Sstevel@tonic-gate# toke.c
293*0Sstevel@tonic-gateuse warnings 'syntax' ;
294*0Sstevel@tonic-gateprintf ("")
295*0Sstevel@tonic-gateEXPECT
296*0Sstevel@tonic-gateprintf (...) interpreted as function at - line 3.
297*0Sstevel@tonic-gate########
298*0Sstevel@tonic-gate# toke.c
299*0Sstevel@tonic-gateno warnings 'syntax' ;
300*0Sstevel@tonic-gateprintf ("")
301*0Sstevel@tonic-gateEXPECT
302*0Sstevel@tonic-gate
303*0Sstevel@tonic-gate########
304*0Sstevel@tonic-gate# toke.c
305*0Sstevel@tonic-gateuse warnings 'syntax' ;
306*0Sstevel@tonic-gatesort ("")
307*0Sstevel@tonic-gateEXPECT
308*0Sstevel@tonic-gatesort (...) interpreted as function at - line 3.
309*0Sstevel@tonic-gate########
310*0Sstevel@tonic-gate# toke.c
311*0Sstevel@tonic-gateno warnings 'syntax' ;
312*0Sstevel@tonic-gatesort ("")
313*0Sstevel@tonic-gateEXPECT
314*0Sstevel@tonic-gate
315*0Sstevel@tonic-gate########
316*0Sstevel@tonic-gate# toke.c
317*0Sstevel@tonic-gateuse warnings 'ambiguous' ;
318*0Sstevel@tonic-gate$a = ${time[2]};
319*0Sstevel@tonic-gateno warnings 'ambiguous' ;
320*0Sstevel@tonic-gate$a = ${time[2]};
321*0Sstevel@tonic-gateEXPECT
322*0Sstevel@tonic-gateAmbiguous use of ${time[...]} resolved to $time[...] at - line 3.
323*0Sstevel@tonic-gate########
324*0Sstevel@tonic-gate# toke.c
325*0Sstevel@tonic-gateuse warnings 'ambiguous' ;
326*0Sstevel@tonic-gate$a = ${time{2}};
327*0Sstevel@tonic-gateEXPECT
328*0Sstevel@tonic-gateAmbiguous use of ${time{...}} resolved to $time{...} at - line 3.
329*0Sstevel@tonic-gate########
330*0Sstevel@tonic-gate# toke.c
331*0Sstevel@tonic-gateno warnings 'ambiguous' ;
332*0Sstevel@tonic-gate$a = ${time{2}};
333*0Sstevel@tonic-gateEXPECT
334*0Sstevel@tonic-gate
335*0Sstevel@tonic-gate########
336*0Sstevel@tonic-gate# toke.c
337*0Sstevel@tonic-gateuse warnings 'ambiguous' ;
338*0Sstevel@tonic-gate$a = ${time} ;
339*0Sstevel@tonic-gateno warnings 'ambiguous' ;
340*0Sstevel@tonic-gate$a = ${time} ;
341*0Sstevel@tonic-gateEXPECT
342*0Sstevel@tonic-gateAmbiguous use of ${time} resolved to $time at - line 3.
343*0Sstevel@tonic-gate########
344*0Sstevel@tonic-gate# toke.c
345*0Sstevel@tonic-gateuse warnings 'ambiguous' ;
346*0Sstevel@tonic-gatesub fred {}
347*0Sstevel@tonic-gate$a = ${fred} ;
348*0Sstevel@tonic-gateno warnings 'ambiguous' ;
349*0Sstevel@tonic-gate$a = ${fred} ;
350*0Sstevel@tonic-gateEXPECT
351*0Sstevel@tonic-gateAmbiguous use of ${fred} resolved to $fred at - line 4.
352*0Sstevel@tonic-gate########
353*0Sstevel@tonic-gate# toke.c
354*0Sstevel@tonic-gateuse warnings 'syntax' ;
355*0Sstevel@tonic-gate$a = _123; print "$a\n";		#( 3	string)
356*0Sstevel@tonic-gate$a = 1_23; print "$a\n";
357*0Sstevel@tonic-gate$a = 12_3; print "$a\n";
358*0Sstevel@tonic-gate$a = 123_; print "$a\n";		#  6
359*0Sstevel@tonic-gate$a = _+123; print "$a\n";		#  7	string)
360*0Sstevel@tonic-gate$a = +_123; print "$a\n";		#( 8	string)
361*0Sstevel@tonic-gate$a = +1_23; print "$a\n";
362*0Sstevel@tonic-gate$a = +12_3; print "$a\n";
363*0Sstevel@tonic-gate$a = +123_; print "$a\n";		# 11
364*0Sstevel@tonic-gate$a = _-123; print "$a\n";		#(12	string)
365*0Sstevel@tonic-gate$a = -_123; print "$a\n";		#(13	string)
366*0Sstevel@tonic-gate$a = -1_23; print "$a\n";
367*0Sstevel@tonic-gate$a = -12_3; print "$a\n";
368*0Sstevel@tonic-gate$a = -123_; print "$a\n";		# 16
369*0Sstevel@tonic-gate$a = 123._456; print "$a\n";		# 17
370*0Sstevel@tonic-gate$a = 123.4_56; print "$a\n";
371*0Sstevel@tonic-gate$a = 123.45_6; print "$a\n";
372*0Sstevel@tonic-gate$a = 123.456_; print "$a\n";		# 20
373*0Sstevel@tonic-gate$a = +123._456; print "$a\n";		# 21
374*0Sstevel@tonic-gate$a = +123.4_56; print "$a\n";
375*0Sstevel@tonic-gate$a = +123.45_6; print "$a\n";
376*0Sstevel@tonic-gate$a = +123.456_; print "$a\n";		# 24
377*0Sstevel@tonic-gate$a = -123._456; print "$a\n";		# 25
378*0Sstevel@tonic-gate$a = -123.4_56; print "$a\n";
379*0Sstevel@tonic-gate$a = -123.45_6; print "$a\n";
380*0Sstevel@tonic-gate$a = -123.456_; print "$a\n";		# 28
381*0Sstevel@tonic-gate$a = 123.456E_12; printf("%.0f\n", $a);	# 29
382*0Sstevel@tonic-gate$a = 123.456E1_2; printf("%.0f\n", $a);
383*0Sstevel@tonic-gate$a = 123.456E12_; printf("%.0f\n", $a);	# 31
384*0Sstevel@tonic-gate$a = 123.456E_+12; printf("%.0f\n", $a);	# 32
385*0Sstevel@tonic-gate$a = 123.456E+_12; printf("%.0f\n", $a);	# 33
386*0Sstevel@tonic-gate$a = 123.456E+1_2; printf("%.0f\n", $a);
387*0Sstevel@tonic-gate$a = 123.456E+12_; printf("%.0f\n", $a);	# 35
388*0Sstevel@tonic-gate$a = 123.456E_-12; print "$a\n";	# 36
389*0Sstevel@tonic-gate$a = 123.456E-_12; print "$a\n";	# 37
390*0Sstevel@tonic-gate$a = 123.456E-1_2; print "$a\n";
391*0Sstevel@tonic-gate$a = 123.456E-12_; print "$a\n";	# 39
392*0Sstevel@tonic-gate$a = 1__23; print "$a\n";		# 40
393*0Sstevel@tonic-gate$a = 12.3__4; print "$a\n";		# 41
394*0Sstevel@tonic-gate$a = 12.34e1__2; printf("%.0f\n", $a);	# 42
395*0Sstevel@tonic-gateno warnings 'syntax' ;
396*0Sstevel@tonic-gate$a = _123; print "$a\n";
397*0Sstevel@tonic-gate$a = 1_23; print "$a\n";
398*0Sstevel@tonic-gate$a = 12_3; print "$a\n";
399*0Sstevel@tonic-gate$a = 123_; print "$a\n";
400*0Sstevel@tonic-gate$a = _+123; print "$a\n";
401*0Sstevel@tonic-gate$a = +_123; print "$a\n";
402*0Sstevel@tonic-gate$a = +1_23; print "$a\n";
403*0Sstevel@tonic-gate$a = +12_3; print "$a\n";
404*0Sstevel@tonic-gate$a = +123_; print "$a\n";
405*0Sstevel@tonic-gate$a = _-123; print "$a\n";
406*0Sstevel@tonic-gate$a = -_123; print "$a\n";
407*0Sstevel@tonic-gate$a = -1_23; print "$a\n";
408*0Sstevel@tonic-gate$a = -12_3; print "$a\n";
409*0Sstevel@tonic-gate$a = -123_; print "$a\n";
410*0Sstevel@tonic-gate$a = 123._456; print "$a\n";
411*0Sstevel@tonic-gate$a = 123.4_56; print "$a\n";
412*0Sstevel@tonic-gate$a = 123.45_6; print "$a\n";
413*0Sstevel@tonic-gate$a = 123.456_; print "$a\n";
414*0Sstevel@tonic-gate$a = +123._456; print "$a\n";
415*0Sstevel@tonic-gate$a = +123.4_56; print "$a\n";
416*0Sstevel@tonic-gate$a = +123.45_6; print "$a\n";
417*0Sstevel@tonic-gate$a = +123.456_; print "$a\n";
418*0Sstevel@tonic-gate$a = -123._456; print "$a\n";
419*0Sstevel@tonic-gate$a = -123.4_56; print "$a\n";
420*0Sstevel@tonic-gate$a = -123.45_6; print "$a\n";
421*0Sstevel@tonic-gate$a = -123.456_; print "$a\n";
422*0Sstevel@tonic-gate$a = 123.456E_12; printf("%.0f\n", $a);
423*0Sstevel@tonic-gate$a = 123.456E1_2; printf("%.0f\n", $a);
424*0Sstevel@tonic-gate$a = 123.456E12_; printf("%.0f\n", $a);
425*0Sstevel@tonic-gate$a = 123.456E_+12; printf("%.0f\n", $a);
426*0Sstevel@tonic-gate$a = 123.456E+_12; printf("%.0f\n", $a);
427*0Sstevel@tonic-gate$a = 123.456E+1_2; printf("%.0f\n", $a);
428*0Sstevel@tonic-gate$a = 123.456E+12_; printf("%.0f\n", $a);
429*0Sstevel@tonic-gate$a = 123.456E_-12; print "$a\n";
430*0Sstevel@tonic-gate$a = 123.456E-_12; print "$a\n";
431*0Sstevel@tonic-gate$a = 123.456E-1_2; print "$a\n";
432*0Sstevel@tonic-gate$a = 123.456E-12_; print "$a\n";
433*0Sstevel@tonic-gate$a = 1__23; print "$a\n";
434*0Sstevel@tonic-gate$a = 12.3__4; print "$a\n";
435*0Sstevel@tonic-gate$a = 12.34e1__2; printf("%.0f\n", $a);
436*0Sstevel@tonic-gateEXPECT
437*0Sstevel@tonic-gateOPTIONS regex
438*0Sstevel@tonic-gateMisplaced _ in number at - line 6.
439*0Sstevel@tonic-gateMisplaced _ in number at - line 11.
440*0Sstevel@tonic-gateMisplaced _ in number at - line 16.
441*0Sstevel@tonic-gateMisplaced _ in number at - line 17.
442*0Sstevel@tonic-gateMisplaced _ in number at - line 20.
443*0Sstevel@tonic-gateMisplaced _ in number at - line 21.
444*0Sstevel@tonic-gateMisplaced _ in number at - line 24.
445*0Sstevel@tonic-gateMisplaced _ in number at - line 25.
446*0Sstevel@tonic-gateMisplaced _ in number at - line 28.
447*0Sstevel@tonic-gateMisplaced _ in number at - line 29.
448*0Sstevel@tonic-gateMisplaced _ in number at - line 31.
449*0Sstevel@tonic-gateMisplaced _ in number at - line 32.
450*0Sstevel@tonic-gateMisplaced _ in number at - line 33.
451*0Sstevel@tonic-gateMisplaced _ in number at - line 35.
452*0Sstevel@tonic-gateMisplaced _ in number at - line 36.
453*0Sstevel@tonic-gateMisplaced _ in number at - line 37.
454*0Sstevel@tonic-gateMisplaced _ in number at - line 39.
455*0Sstevel@tonic-gateMisplaced _ in number at - line 40.
456*0Sstevel@tonic-gateMisplaced _ in number at - line 41.
457*0Sstevel@tonic-gateMisplaced _ in number at - line 42.
458*0Sstevel@tonic-gate_123
459*0Sstevel@tonic-gate123
460*0Sstevel@tonic-gate123
461*0Sstevel@tonic-gate123
462*0Sstevel@tonic-gate123
463*0Sstevel@tonic-gate_123
464*0Sstevel@tonic-gate123
465*0Sstevel@tonic-gate123
466*0Sstevel@tonic-gate123
467*0Sstevel@tonic-gate-123
468*0Sstevel@tonic-gate-_123
469*0Sstevel@tonic-gate-123
470*0Sstevel@tonic-gate-123
471*0Sstevel@tonic-gate-123
472*0Sstevel@tonic-gate123.456
473*0Sstevel@tonic-gate123.456
474*0Sstevel@tonic-gate123.456
475*0Sstevel@tonic-gate123.456
476*0Sstevel@tonic-gate123.456
477*0Sstevel@tonic-gate123.456
478*0Sstevel@tonic-gate123.456
479*0Sstevel@tonic-gate123.456
480*0Sstevel@tonic-gate-123.456
481*0Sstevel@tonic-gate-123.456
482*0Sstevel@tonic-gate-123.456
483*0Sstevel@tonic-gate-123.456
484*0Sstevel@tonic-gate123456000000000
485*0Sstevel@tonic-gate123456000000000
486*0Sstevel@tonic-gate123456000000000
487*0Sstevel@tonic-gate123456000000000
488*0Sstevel@tonic-gate123456000000000
489*0Sstevel@tonic-gate123456000000000
490*0Sstevel@tonic-gate123456000000000
491*0Sstevel@tonic-gate1.23456e-0?10
492*0Sstevel@tonic-gate1.23456e-0?10
493*0Sstevel@tonic-gate1.23456e-0?10
494*0Sstevel@tonic-gate1.23456e-0?10
495*0Sstevel@tonic-gate123
496*0Sstevel@tonic-gate12.34
497*0Sstevel@tonic-gate12340000000000
498*0Sstevel@tonic-gate_123
499*0Sstevel@tonic-gate123
500*0Sstevel@tonic-gate123
501*0Sstevel@tonic-gate123
502*0Sstevel@tonic-gate123
503*0Sstevel@tonic-gate_123
504*0Sstevel@tonic-gate123
505*0Sstevel@tonic-gate123
506*0Sstevel@tonic-gate123
507*0Sstevel@tonic-gate-123
508*0Sstevel@tonic-gate-_123
509*0Sstevel@tonic-gate-123
510*0Sstevel@tonic-gate-123
511*0Sstevel@tonic-gate-123
512*0Sstevel@tonic-gate123.456
513*0Sstevel@tonic-gate123.456
514*0Sstevel@tonic-gate123.456
515*0Sstevel@tonic-gate123.456
516*0Sstevel@tonic-gate123.456
517*0Sstevel@tonic-gate123.456
518*0Sstevel@tonic-gate123.456
519*0Sstevel@tonic-gate123.456
520*0Sstevel@tonic-gate-123.456
521*0Sstevel@tonic-gate-123.456
522*0Sstevel@tonic-gate-123.456
523*0Sstevel@tonic-gate-123.456
524*0Sstevel@tonic-gate123456000000000
525*0Sstevel@tonic-gate123456000000000
526*0Sstevel@tonic-gate123456000000000
527*0Sstevel@tonic-gate123456000000000
528*0Sstevel@tonic-gate123456000000000
529*0Sstevel@tonic-gate123456000000000
530*0Sstevel@tonic-gate123456000000000
531*0Sstevel@tonic-gate1.23456e-0?10
532*0Sstevel@tonic-gate1.23456e-0?10
533*0Sstevel@tonic-gate1.23456e-0?10
534*0Sstevel@tonic-gate1.23456e-0?10
535*0Sstevel@tonic-gate123
536*0Sstevel@tonic-gate12.34
537*0Sstevel@tonic-gate12340000000000
538*0Sstevel@tonic-gate########
539*0Sstevel@tonic-gate# toke.c
540*0Sstevel@tonic-gateuse warnings 'bareword' ;
541*0Sstevel@tonic-gate#line 25 "bar"
542*0Sstevel@tonic-gate$a = FRED:: ;
543*0Sstevel@tonic-gateno warnings 'bareword' ;
544*0Sstevel@tonic-gate#line 25 "bar"
545*0Sstevel@tonic-gate$a = FRED:: ;
546*0Sstevel@tonic-gateEXPECT
547*0Sstevel@tonic-gateBareword "FRED::" refers to nonexistent package at bar line 25.
548*0Sstevel@tonic-gate########
549*0Sstevel@tonic-gate# toke.c
550*0Sstevel@tonic-gateuse warnings 'ambiguous' ;
551*0Sstevel@tonic-gatesub time {}
552*0Sstevel@tonic-gatemy $a = time() ;
553*0Sstevel@tonic-gateno warnings 'ambiguous' ;
554*0Sstevel@tonic-gatemy $b = time() ;
555*0Sstevel@tonic-gateEXPECT
556*0Sstevel@tonic-gateAmbiguous call resolved as CORE::time(), qualify as such or use & at - line 4.
557*0Sstevel@tonic-gate########
558*0Sstevel@tonic-gate# toke.c
559*0Sstevel@tonic-gateuse warnings ;
560*0Sstevel@tonic-gateeval <<'EOE';
561*0Sstevel@tonic-gate#  line 30 "foo"
562*0Sstevel@tonic-gatewarn "yelp";
563*0Sstevel@tonic-gate{
564*0Sstevel@tonic-gate  $_ = " \x{123} " ;
565*0Sstevel@tonic-gate}
566*0Sstevel@tonic-gateEOE
567*0Sstevel@tonic-gateEXPECT
568*0Sstevel@tonic-gateyelp at foo line 30.
569*0Sstevel@tonic-gate########
570*0Sstevel@tonic-gate# toke.c
571*0Sstevel@tonic-gatemy $a = rand + 4 ;
572*0Sstevel@tonic-gateEXPECT
573*0Sstevel@tonic-gateWarning: Use of "rand" without parentheses is ambiguous at - line 2.
574*0Sstevel@tonic-gate########
575*0Sstevel@tonic-gate# toke.c
576*0Sstevel@tonic-gate$^W = 0 ;
577*0Sstevel@tonic-gatemy $a = rand + 4 ;
578*0Sstevel@tonic-gate{
579*0Sstevel@tonic-gate    no warnings 'ambiguous' ;
580*0Sstevel@tonic-gate    $a = rand + 4 ;
581*0Sstevel@tonic-gate    use warnings 'ambiguous' ;
582*0Sstevel@tonic-gate    $a = rand + 4 ;
583*0Sstevel@tonic-gate}
584*0Sstevel@tonic-gate$a = rand + 4 ;
585*0Sstevel@tonic-gateEXPECT
586*0Sstevel@tonic-gateWarning: Use of "rand" without parentheses is ambiguous at - line 3.
587*0Sstevel@tonic-gateWarning: Use of "rand" without parentheses is ambiguous at - line 8.
588*0Sstevel@tonic-gateWarning: Use of "rand" without parentheses is ambiguous at - line 10.
589*0Sstevel@tonic-gate########
590*0Sstevel@tonic-gate# toke.c
591*0Sstevel@tonic-gatesub fred {};
592*0Sstevel@tonic-gate-fred ;
593*0Sstevel@tonic-gateEXPECT
594*0Sstevel@tonic-gateAmbiguous use of -fred resolved as -&fred() at - line 3.
595*0Sstevel@tonic-gate########
596*0Sstevel@tonic-gate# toke.c
597*0Sstevel@tonic-gate$^W = 0 ;
598*0Sstevel@tonic-gatesub fred {} ;
599*0Sstevel@tonic-gate-fred ;
600*0Sstevel@tonic-gate{
601*0Sstevel@tonic-gate    no warnings 'ambiguous' ;
602*0Sstevel@tonic-gate    -fred ;
603*0Sstevel@tonic-gate    use warnings 'ambiguous' ;
604*0Sstevel@tonic-gate    -fred ;
605*0Sstevel@tonic-gate}
606*0Sstevel@tonic-gate-fred ;
607*0Sstevel@tonic-gateEXPECT
608*0Sstevel@tonic-gateAmbiguous use of -fred resolved as -&fred() at - line 4.
609*0Sstevel@tonic-gateAmbiguous use of -fred resolved as -&fred() at - line 9.
610*0Sstevel@tonic-gateAmbiguous use of -fred resolved as -&fred() at - line 11.
611*0Sstevel@tonic-gate########
612*0Sstevel@tonic-gate# toke.c
613*0Sstevel@tonic-gateopen FOO || time;
614*0Sstevel@tonic-gateEXPECT
615*0Sstevel@tonic-gatePrecedence problem: open FOO should be open(FOO) at - line 2.
616*0Sstevel@tonic-gate########
617*0Sstevel@tonic-gate# toke.c (and [perl #16184])
618*0Sstevel@tonic-gateopen FOO => "<&0"; close FOO;
619*0Sstevel@tonic-gateEXPECT
620*0Sstevel@tonic-gate########
621*0Sstevel@tonic-gate# toke.c
622*0Sstevel@tonic-gate$^W = 0 ;
623*0Sstevel@tonic-gateopen FOO || time;
624*0Sstevel@tonic-gate{
625*0Sstevel@tonic-gate    no warnings 'precedence' ;
626*0Sstevel@tonic-gate    open FOO || time;
627*0Sstevel@tonic-gate    use warnings 'precedence' ;
628*0Sstevel@tonic-gate    open FOO || time;
629*0Sstevel@tonic-gate}
630*0Sstevel@tonic-gateopen FOO || time;
631*0Sstevel@tonic-gateEXPECT
632*0Sstevel@tonic-gatePrecedence problem: open FOO should be open(FOO) at - line 3.
633*0Sstevel@tonic-gatePrecedence problem: open FOO should be open(FOO) at - line 8.
634*0Sstevel@tonic-gatePrecedence problem: open FOO should be open(FOO) at - line 10.
635*0Sstevel@tonic-gate########
636*0Sstevel@tonic-gate# toke.c
637*0Sstevel@tonic-gate$^W = 0 ;
638*0Sstevel@tonic-gate*foo *foo ;
639*0Sstevel@tonic-gate{
640*0Sstevel@tonic-gate    no warnings 'ambiguous' ;
641*0Sstevel@tonic-gate    *foo *foo ;
642*0Sstevel@tonic-gate    use warnings 'ambiguous' ;
643*0Sstevel@tonic-gate    *foo *foo ;
644*0Sstevel@tonic-gate}
645*0Sstevel@tonic-gate*foo *foo ;
646*0Sstevel@tonic-gateEXPECT
647*0Sstevel@tonic-gateOperator or semicolon missing before *foo at - line 3.
648*0Sstevel@tonic-gateAmbiguous use of * resolved as operator * at - line 3.
649*0Sstevel@tonic-gateOperator or semicolon missing before *foo at - line 8.
650*0Sstevel@tonic-gateAmbiguous use of * resolved as operator * at - line 8.
651*0Sstevel@tonic-gateOperator or semicolon missing before *foo at - line 10.
652*0Sstevel@tonic-gateAmbiguous use of * resolved as operator * at - line 10.
653*0Sstevel@tonic-gate########
654*0Sstevel@tonic-gate# toke.c
655*0Sstevel@tonic-gateuse warnings 'misc' ;
656*0Sstevel@tonic-gatemy $a = "\m" ;
657*0Sstevel@tonic-gateno warnings 'misc' ;
658*0Sstevel@tonic-gate$a = "\m" ;
659*0Sstevel@tonic-gateEXPECT
660*0Sstevel@tonic-gateUnrecognized escape \m passed through at - line 3.
661*0Sstevel@tonic-gate########
662*0Sstevel@tonic-gate# toke.c
663*0Sstevel@tonic-gateuse warnings 'portable' ;
664*0Sstevel@tonic-gatemy $a =  0b011111111111111111111111111111110 ;
665*0Sstevel@tonic-gate   $a =  0b011111111111111111111111111111111 ;
666*0Sstevel@tonic-gate   $a =  0b111111111111111111111111111111111 ;
667*0Sstevel@tonic-gate   $a =  0x0fffffffe ;
668*0Sstevel@tonic-gate   $a =  0x0ffffffff ;
669*0Sstevel@tonic-gate   $a =  0x1ffffffff ;
670*0Sstevel@tonic-gate   $a =  0037777777776 ;
671*0Sstevel@tonic-gate   $a =  0037777777777 ;
672*0Sstevel@tonic-gate   $a =  0047777777777 ;
673*0Sstevel@tonic-gateno warnings 'portable' ;
674*0Sstevel@tonic-gate   $a =  0b011111111111111111111111111111110 ;
675*0Sstevel@tonic-gate   $a =  0b011111111111111111111111111111111 ;
676*0Sstevel@tonic-gate   $a =  0b111111111111111111111111111111111 ;
677*0Sstevel@tonic-gate   $a =  0x0fffffffe ;
678*0Sstevel@tonic-gate   $a =  0x0ffffffff ;
679*0Sstevel@tonic-gate   $a =  0x1ffffffff ;
680*0Sstevel@tonic-gate   $a =  0037777777776 ;
681*0Sstevel@tonic-gate   $a =  0037777777777 ;
682*0Sstevel@tonic-gate   $a =  0047777777777 ;
683*0Sstevel@tonic-gateEXPECT
684*0Sstevel@tonic-gateBinary number > 0b11111111111111111111111111111111 non-portable at - line 5.
685*0Sstevel@tonic-gateHexadecimal number > 0xffffffff non-portable at - line 8.
686*0Sstevel@tonic-gateOctal number > 037777777777 non-portable at - line 11.
687*0Sstevel@tonic-gate########
688*0Sstevel@tonic-gate# toke.c
689*0Sstevel@tonic-gateuse warnings 'overflow' ;
690*0Sstevel@tonic-gatemy $a =  0b011111111111111111111111111111110 ;
691*0Sstevel@tonic-gate   $a =  0b011111111111111111111111111111111 ;
692*0Sstevel@tonic-gate   $a =  0b10000000000000000000000000000000000000000000000000000000000000000 ;
693*0Sstevel@tonic-gate   $a =  0x0fffffffe ;
694*0Sstevel@tonic-gate   $a =  0x0ffffffff ;
695*0Sstevel@tonic-gate   $a =  0x10000000000000000 ;
696*0Sstevel@tonic-gate   $a =  0037777777776 ;
697*0Sstevel@tonic-gate   $a =  0037777777777 ;
698*0Sstevel@tonic-gate   $a =  002000000000000000000000;
699*0Sstevel@tonic-gateno warnings 'overflow' ;
700*0Sstevel@tonic-gate   $a =  0b011111111111111111111111111111110 ;
701*0Sstevel@tonic-gate   $a =  0b011111111111111111111111111111111 ;
702*0Sstevel@tonic-gate   $a =  0b10000000000000000000000000000000000000000000000000000000000000000 ;
703*0Sstevel@tonic-gate   $a =  0x0fffffffe ;
704*0Sstevel@tonic-gate   $a =  0x0ffffffff ;
705*0Sstevel@tonic-gate   $a =  0x10000000000000000 ;
706*0Sstevel@tonic-gate   $a =  0037777777776 ;
707*0Sstevel@tonic-gate   $a =  0037777777777 ;
708*0Sstevel@tonic-gate   $a =  002000000000000000000000;
709*0Sstevel@tonic-gateEXPECT
710*0Sstevel@tonic-gateInteger overflow in binary number at - line 5.
711*0Sstevel@tonic-gateInteger overflow in hexadecimal number at - line 8.
712*0Sstevel@tonic-gateInteger overflow in octal number at - line 11.
713*0Sstevel@tonic-gate########
714*0Sstevel@tonic-gate# toke.c
715*0Sstevel@tonic-gateBEGIN { $^C = 1; }
716*0Sstevel@tonic-gateuse warnings 'misc';
717*0Sstevel@tonic-gatedump;
718*0Sstevel@tonic-gateCORE::dump;
719*0Sstevel@tonic-gateEXPECT
720*0Sstevel@tonic-gatedump() better written as CORE::dump() at - line 4.
721*0Sstevel@tonic-gate- syntax OK
722*0Sstevel@tonic-gate########
723*0Sstevel@tonic-gate# toke.c
724*0Sstevel@tonic-gateuse warnings 'misc';
725*0Sstevel@tonic-gateuse subs qw/dump/;
726*0Sstevel@tonic-gatesub dump { print "no warning for overriden dump\n"; }
727*0Sstevel@tonic-gatedump;
728*0Sstevel@tonic-gateEXPECT
729*0Sstevel@tonic-gateno warning for overriden dump
730*0Sstevel@tonic-gate########
731*0Sstevel@tonic-gate# toke.c
732*0Sstevel@tonic-gateuse warnings 'ambiguous';
733*0Sstevel@tonic-gate"@mjd_previously_unused_array";
734*0Sstevel@tonic-gateno warnings 'ambiguous';
735*0Sstevel@tonic-gate"@mjd_previously_unused_array";
736*0Sstevel@tonic-gateEXPECT
737*0Sstevel@tonic-gatePossible unintended interpolation of @mjd_previously_unused_array in string at - line 3.
738*0Sstevel@tonic-gate########
739*0Sstevel@tonic-gate# toke.c
740*0Sstevel@tonic-gate# The \q should warn, the \_ should NOT warn.
741*0Sstevel@tonic-gateuse warnings 'misc';
742*0Sstevel@tonic-gate"foo" =~ /\q/;
743*0Sstevel@tonic-gate"bar" =~ /\_/;
744*0Sstevel@tonic-gateno warnings 'misc';
745*0Sstevel@tonic-gate"foo" =~ /\q/;
746*0Sstevel@tonic-gate"bar" =~ /\_/;
747*0Sstevel@tonic-gateEXPECT
748*0Sstevel@tonic-gateUnrecognized escape \q passed through at - line 4.
749*0Sstevel@tonic-gate########
750*0Sstevel@tonic-gate# toke.c
751*0Sstevel@tonic-gate# 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com
752*0Sstevel@tonic-gateuse warnings 'regexp';
753*0Sstevel@tonic-gate"foo" =~ /foo/c;
754*0Sstevel@tonic-gate"foo" =~ /foo/cg;
755*0Sstevel@tonic-gateno warnings 'regexp';
756*0Sstevel@tonic-gate"foo" =~ /foo/c;
757*0Sstevel@tonic-gate"foo" =~ /foo/cg;
758*0Sstevel@tonic-gateEXPECT
759*0Sstevel@tonic-gateUse of /c modifier is meaningless without /g at - line 4.
760*0Sstevel@tonic-gate########
761*0Sstevel@tonic-gate# toke.c
762*0Sstevel@tonic-gate# 20020328 mjd-perl-patch+@plover.com at behest of jfriedl@yahoo.com
763*0Sstevel@tonic-gateuse warnings 'regexp';
764*0Sstevel@tonic-gate$_ = "ab" ;
765*0Sstevel@tonic-gates/ab/ab/c;
766*0Sstevel@tonic-gates/ab/ab/cg;
767*0Sstevel@tonic-gateno warnings 'regexp';
768*0Sstevel@tonic-gates/ab/ab/c;
769*0Sstevel@tonic-gates/ab/ab/cg;
770*0Sstevel@tonic-gateEXPECT
771*0Sstevel@tonic-gateUse of /c modifier is meaningless in s/// at - line 5.
772*0Sstevel@tonic-gateUse of /c modifier is meaningless in s/// at - line 6.
773*0Sstevel@tonic-gate########
774*0Sstevel@tonic-gate-wa
775*0Sstevel@tonic-gate# toke.c
776*0Sstevel@tonic-gate# 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings
777*0Sstevel@tonic-gateprint "@F\n";
778*0Sstevel@tonic-gateEXPECT
779*0Sstevel@tonic-gate
780*0Sstevel@tonic-gate########
781*0Sstevel@tonic-gate-w
782*0Sstevel@tonic-gate# toke.c
783*0Sstevel@tonic-gate# 20020414 mjd-perl-patch+@plover.com # -a flag should suppress these warnings
784*0Sstevel@tonic-gateprint "@F\n";
785*0Sstevel@tonic-gateEXPECT
786*0Sstevel@tonic-gatePossible unintended interpolation of @F in string at - line 4.
787*0Sstevel@tonic-gateName "main::F" used only once: possible typo at - line 4.
788*0Sstevel@tonic-gate########
789*0Sstevel@tonic-gate-wa
790*0Sstevel@tonic-gate# toke.c
791*0Sstevel@tonic-gate# 20020414 mjd-perl-patch+@plover.com
792*0Sstevel@tonic-gateEXPECT
793*0Sstevel@tonic-gate
794*0Sstevel@tonic-gate########
795*0Sstevel@tonic-gate# toke.c
796*0Sstevel@tonic-gate# 20020414 mjd-perl-patch+@plover.com
797*0Sstevel@tonic-gate# In 5.7.3, this emitted "Possible unintended interpolation" warnings
798*0Sstevel@tonic-gateuse warnings 'ambiguous';
799*0Sstevel@tonic-gate$s = "(@-)(@+)";
800*0Sstevel@tonic-gateEXPECT
801*0Sstevel@tonic-gate
802*0Sstevel@tonic-gate########
803*0Sstevel@tonic-gate# toke.c
804*0Sstevel@tonic-gate# mandatory warning
805*0Sstevel@tonic-gateeval q/if ($a) { } elseif ($b) { }/;
806*0Sstevel@tonic-gateno warnings "syntax";
807*0Sstevel@tonic-gateeval q/if ($a) { } elseif ($b) { }/;
808*0Sstevel@tonic-gateEXPECT
809*0Sstevel@tonic-gateelseif should be elsif at (eval 1) line 1.
810*0Sstevel@tonic-gate########
811*0Sstevel@tonic-gate# toke.c
812*0Sstevel@tonic-gate# mandatory warning
813*0Sstevel@tonic-gateeval q/5 6/;
814*0Sstevel@tonic-gateno warnings "syntax";
815*0Sstevel@tonic-gateeval q/5 6/;
816*0Sstevel@tonic-gateEXPECT
817*0Sstevel@tonic-gateNumber found where operator expected at (eval 1) line 1, near "5 6"
818*0Sstevel@tonic-gate	(Missing operator before  6?)
819*0Sstevel@tonic-gate
820