Commit | Line | Data |
599cee73 |
1 | op.c AOK |
2 | |
3 | "my" variable %s masks earlier declaration in same scope |
4 | my $x; |
5 | my $x ; |
6 | |
7 | Variable "%s" may be unavailable |
8 | sub x { |
9 | my $x; |
10 | sub y { |
11 | $x |
12 | } |
13 | } |
14 | |
15 | Variable "%s" will not stay shared |
16 | sub x { |
17 | my $x; |
18 | sub y { |
19 | sub { $x } |
20 | } |
21 | } |
22 | |
23 | Found = in conditional, should be == |
24 | 1 if $a = 1 ; |
25 | |
26 | Use of implicit split to @_ is deprecated |
27 | split ; |
28 | |
29 | Use of implicit split to @_ is deprecated |
30 | $a = split ; |
31 | |
32 | Useless use of time in void context |
33 | Useless use of a variable in void context |
34 | Useless use of a constant in void context |
35 | time ; |
36 | $a ; |
37 | "abc" |
38 | |
39 | Applying %s to %s will act on scalar(%s) |
40 | my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; |
41 | @a =~ /abc/ ; |
42 | @a =~ s/a/b/ ; |
43 | @a =~ tr/a/b/ ; |
44 | @$b =~ /abc/ ; |
45 | @$b =~ s/a/b/ ; |
46 | @$b =~ tr/a/b/ ; |
47 | %a =~ /abc/ ; |
48 | %a =~ s/a/b/ ; |
49 | %a =~ tr/a/b/ ; |
50 | %$c =~ /abc/ ; |
51 | %$c =~ s/a/b/ ; |
52 | %$c =~ tr/a/b/ ; |
53 | |
54 | |
df5b6949 |
55 | Parentheses missing around "my" list at -e line 1. |
599cee73 |
56 | my $a, $b = (1,2); |
57 | |
df5b6949 |
58 | Parentheses missing around "local" list at -e line 1. |
599cee73 |
59 | local $a, $b = (1,2); |
60 | |
34d09196 |
61 | Bareword found in conditional at -e line 1. |
e476b1b5 |
62 | use warnings 'bareword'; my $x = print(ABC || 1); |
599cee73 |
63 | |
64 | Value of %s may be \"0\"; use \"defined\" |
65 | $x = 1 if $x = <FH> ; |
66 | $x = 1 while $x = <FH> ; |
67 | |
68 | Subroutine fred redefined at -e line 1. |
69 | sub fred{1;} sub fred{1;} |
70 | |
71 | Constant subroutine %s redefined |
72 | sub fred() {1;} sub fred() {1;} |
73 | |
74 | Format FRED redefined at /tmp/x line 5. |
75 | format FRED = |
76 | . |
77 | format FRED = |
78 | . |
79 | |
80 | Array @%s missing the @ in argument %d of %s() |
81 | push fred ; |
82 | |
83 | Hash %%%s missing the %% in argument %d of %s() |
84 | keys joe ; |
85 | |
86 | Statement unlikely to be reached |
87 | (Maybe you meant system() when you said exec()? |
88 | exec "true" ; my $a |
89 | |
f10b0346 |
90 | defined(@array) is deprecated |
69794302 |
91 | (Maybe you should just omit the defined()?) |
69794302 |
92 | my @a ; defined @a ; |
93 | defined (@a = (1,2,3)) ; |
94 | |
f10b0346 |
95 | defined(%hash) is deprecated |
69794302 |
96 | (Maybe you should just omit the defined()?) |
69794302 |
97 | my %h ; defined %h ; |
eb6e2d6f |
98 | |
99 | /---/ should probably be written as "---" |
100 | join(/---/, @foo); |
599cee73 |
101 | |
767a6a26 |
102 | %s() called too early to check prototype [Perl_peep] |
103 | fred() ; sub fred ($$) {} |
104 | |
105 | |
0453d815 |
106 | Mandatory Warnings |
107 | ------------------ |
108 | Prototype mismatch: [cv_ckproto] |
109 | sub fred() ; |
110 | sub fred($) {} |
111 | |
112 | %s never introduced [pad_leavemy] TODO |
113 | Runaway prototype [newSUB] TODO |
114 | oops: oopsAV [oopsAV] TODO |
115 | oops: oopsHV [oopsHV] TODO |
116 | |
0453d815 |
117 | |
599cee73 |
118 | __END__ |
119 | # op.c |
e476b1b5 |
120 | use warnings 'misc' ; |
599cee73 |
121 | my $x ; |
122 | my $x ; |
e476b1b5 |
123 | no warnings 'misc' ; |
0453d815 |
124 | my $x ; |
599cee73 |
125 | EXPECT |
126 | "my" variable $x masks earlier declaration in same scope at - line 4. |
127 | ######## |
128 | # op.c |
e476b1b5 |
129 | use warnings 'closure' ; |
599cee73 |
130 | sub x { |
131 | my $x; |
132 | sub y { |
133 | $x |
134 | } |
135 | } |
136 | EXPECT |
137 | Variable "$x" will not stay shared at - line 7. |
138 | ######## |
139 | # op.c |
e476b1b5 |
140 | no warnings 'closure' ; |
0453d815 |
141 | sub x { |
142 | my $x; |
143 | sub y { |
144 | $x |
145 | } |
146 | } |
147 | EXPECT |
148 | |
149 | ######## |
150 | # op.c |
e476b1b5 |
151 | use warnings 'closure' ; |
599cee73 |
152 | sub x { |
153 | my $x; |
154 | sub y { |
155 | sub { $x } |
156 | } |
157 | } |
158 | EXPECT |
159 | Variable "$x" may be unavailable at - line 6. |
160 | ######## |
161 | # op.c |
e476b1b5 |
162 | no warnings 'closure' ; |
0453d815 |
163 | sub x { |
164 | my $x; |
165 | sub y { |
166 | sub { $x } |
167 | } |
168 | } |
169 | EXPECT |
170 | |
171 | ######## |
172 | # op.c |
4438c4b7 |
173 | use warnings 'syntax' ; |
599cee73 |
174 | 1 if $a = 1 ; |
4438c4b7 |
175 | no warnings 'syntax' ; |
0453d815 |
176 | 1 if $a = 1 ; |
599cee73 |
177 | EXPECT |
178 | Found = in conditional, should be == at - line 3. |
179 | ######## |
180 | # op.c |
4438c4b7 |
181 | use warnings 'deprecated' ; |
599cee73 |
182 | split ; |
4438c4b7 |
183 | no warnings 'deprecated' ; |
0453d815 |
184 | split ; |
599cee73 |
185 | EXPECT |
186 | Use of implicit split to @_ is deprecated at - line 3. |
187 | ######## |
188 | # op.c |
4438c4b7 |
189 | use warnings 'deprecated' ; |
599cee73 |
190 | $a = split ; |
4438c4b7 |
191 | no warnings 'deprecated' ; |
0453d815 |
192 | $a = split ; |
599cee73 |
193 | EXPECT |
194 | Use of implicit split to @_ is deprecated at - line 3. |
195 | ######## |
196 | # op.c |
4438c4b7 |
197 | use warnings 'void' ; close STDIN ; |
599cee73 |
198 | 1 x 3 ; # OP_REPEAT |
199 | # OP_GVSV |
200 | wantarray ; # OP_WANTARRAY |
201 | # OP_GV |
202 | # OP_PADSV |
203 | # OP_PADAV |
204 | # OP_PADHV |
205 | # OP_PADANY |
206 | # OP_AV2ARYLEN |
207 | ref ; # OP_REF |
208 | \@a ; # OP_REFGEN |
209 | \$a ; # OP_SREFGEN |
210 | defined $a ; # OP_DEFINED |
211 | hex $a ; # OP_HEX |
212 | oct $a ; # OP_OCT |
213 | length $a ; # OP_LENGTH |
214 | substr $a,1 ; # OP_SUBSTR |
215 | vec $a,1,2 ; # OP_VEC |
216 | index $a,1,2 ; # OP_INDEX |
217 | rindex $a,1,2 ; # OP_RINDEX |
218 | sprintf $a ; # OP_SPRINTF |
219 | $a[0] ; # OP_AELEM |
220 | # OP_AELEMFAST |
221 | @a[0] ; # OP_ASLICE |
222 | #values %a ; # OP_VALUES |
223 | #keys %a ; # OP_KEYS |
224 | $a{0} ; # OP_HELEM |
225 | @a{0} ; # OP_HSLICE |
226 | unpack "a", "a" ; # OP_UNPACK |
227 | pack $a,"" ; # OP_PACK |
228 | join "" ; # OP_JOIN |
229 | (@a)[0,1] ; # OP_LSLICE |
230 | # OP_ANONLIST |
231 | # OP_ANONHASH |
232 | sort(1,2) ; # OP_SORT |
233 | reverse(1,2) ; # OP_REVERSE |
234 | # OP_RANGE |
235 | # OP_FLIP |
236 | (1 ..2) ; # OP_FLOP |
237 | caller ; # OP_CALLER |
238 | fileno STDIN ; # OP_FILENO |
239 | eof STDIN ; # OP_EOF |
240 | tell STDIN ; # OP_TELL |
241 | readlink 1; # OP_READLINK |
242 | time ; # OP_TIME |
243 | localtime ; # OP_LOCALTIME |
244 | gmtime ; # OP_GMTIME |
dfe13c55 |
245 | eval { getgrnam 1 }; # OP_GGRNAM |
246 | eval { getgrgid 1 }; # OP_GGRGID |
247 | eval { getpwnam 1 }; # OP_GPWNAM |
248 | eval { getpwuid 1 }; # OP_GPWUID |
599cee73 |
249 | EXPECT |
42d38218 |
250 | Useless use of repeat (x) in void context at - line 3. |
599cee73 |
251 | Useless use of wantarray in void context at - line 5. |
252 | Useless use of reference-type operator in void context at - line 12. |
253 | Useless use of reference constructor in void context at - line 13. |
d6c467eb |
254 | Useless use of single ref constructor in void context at - line 14. |
599cee73 |
255 | Useless use of defined operator in void context at - line 15. |
256 | Useless use of hex in void context at - line 16. |
257 | Useless use of oct in void context at - line 17. |
258 | Useless use of length in void context at - line 18. |
259 | Useless use of substr in void context at - line 19. |
260 | Useless use of vec in void context at - line 20. |
261 | Useless use of index in void context at - line 21. |
262 | Useless use of rindex in void context at - line 22. |
263 | Useless use of sprintf in void context at - line 23. |
264 | Useless use of array element in void context at - line 24. |
265 | Useless use of array slice in void context at - line 26. |
f1612b5c |
266 | Useless use of hash element in void context at - line 29. |
599cee73 |
267 | Useless use of hash slice in void context at - line 30. |
268 | Useless use of unpack in void context at - line 31. |
269 | Useless use of pack in void context at - line 32. |
270 | Useless use of join in void context at - line 33. |
271 | Useless use of list slice in void context at - line 34. |
272 | Useless use of sort in void context at - line 37. |
273 | Useless use of reverse in void context at - line 38. |
274 | Useless use of range (or flop) in void context at - line 41. |
275 | Useless use of caller in void context at - line 42. |
276 | Useless use of fileno in void context at - line 43. |
277 | Useless use of eof in void context at - line 44. |
278 | Useless use of tell in void context at - line 45. |
279 | Useless use of readlink in void context at - line 46. |
280 | Useless use of time in void context at - line 47. |
281 | Useless use of localtime in void context at - line 48. |
282 | Useless use of gmtime in void context at - line 49. |
283 | Useless use of getgrnam in void context at - line 50. |
284 | Useless use of getgrgid in void context at - line 51. |
285 | Useless use of getpwnam in void context at - line 52. |
286 | Useless use of getpwuid in void context at - line 53. |
287 | ######## |
288 | # op.c |
4438c4b7 |
289 | no warnings 'void' ; close STDIN ; |
0453d815 |
290 | 1 x 3 ; # OP_REPEAT |
291 | # OP_GVSV |
292 | wantarray ; # OP_WANTARRAY |
293 | # OP_GV |
294 | # OP_PADSV |
295 | # OP_PADAV |
296 | # OP_PADHV |
297 | # OP_PADANY |
298 | # OP_AV2ARYLEN |
299 | ref ; # OP_REF |
300 | \@a ; # OP_REFGEN |
301 | \$a ; # OP_SREFGEN |
302 | defined $a ; # OP_DEFINED |
303 | hex $a ; # OP_HEX |
304 | oct $a ; # OP_OCT |
305 | length $a ; # OP_LENGTH |
306 | substr $a,1 ; # OP_SUBSTR |
307 | vec $a,1,2 ; # OP_VEC |
308 | index $a,1,2 ; # OP_INDEX |
309 | rindex $a,1,2 ; # OP_RINDEX |
310 | sprintf $a ; # OP_SPRINTF |
311 | $a[0] ; # OP_AELEM |
312 | # OP_AELEMFAST |
313 | @a[0] ; # OP_ASLICE |
314 | #values %a ; # OP_VALUES |
315 | #keys %a ; # OP_KEYS |
316 | $a{0} ; # OP_HELEM |
317 | @a{0} ; # OP_HSLICE |
318 | unpack "a", "a" ; # OP_UNPACK |
319 | pack $a,"" ; # OP_PACK |
320 | join "" ; # OP_JOIN |
321 | (@a)[0,1] ; # OP_LSLICE |
322 | # OP_ANONLIST |
323 | # OP_ANONHASH |
324 | sort(1,2) ; # OP_SORT |
325 | reverse(1,2) ; # OP_REVERSE |
326 | # OP_RANGE |
327 | # OP_FLIP |
328 | (1 ..2) ; # OP_FLOP |
329 | caller ; # OP_CALLER |
330 | fileno STDIN ; # OP_FILENO |
331 | eof STDIN ; # OP_EOF |
332 | tell STDIN ; # OP_TELL |
333 | readlink 1; # OP_READLINK |
334 | time ; # OP_TIME |
335 | localtime ; # OP_LOCALTIME |
336 | gmtime ; # OP_GMTIME |
337 | eval { getgrnam 1 }; # OP_GGRNAM |
338 | eval { getgrgid 1 }; # OP_GGRGID |
339 | eval { getpwnam 1 }; # OP_GPWNAM |
340 | eval { getpwuid 1 }; # OP_GPWUID |
341 | EXPECT |
342 | ######## |
343 | # op.c |
4438c4b7 |
344 | use warnings 'void' ; |
68c73484 |
345 | for (@{[0]}) { "$_" } # check warning isn't duplicated |
4438c4b7 |
346 | no warnings 'void' ; |
0453d815 |
347 | for (@{[0]}) { "$_" } # check warning isn't duplicated |
68c73484 |
348 | EXPECT |
349 | Useless use of string in void context at - line 3. |
350 | ######## |
351 | # op.c |
4438c4b7 |
352 | use warnings 'void' ; |
599cee73 |
353 | use Config ; |
354 | BEGIN { |
355 | if ( ! $Config{d_telldir}) { |
356 | print <<EOM ; |
357 | SKIPPED |
358 | # telldir not present |
359 | EOM |
360 | exit |
361 | } |
362 | } |
363 | telldir 1 ; # OP_TELLDIR |
4438c4b7 |
364 | no warnings 'void' ; |
0453d815 |
365 | telldir 1 ; # OP_TELLDIR |
599cee73 |
366 | EXPECT |
367 | Useless use of telldir in void context at - line 13. |
368 | ######## |
369 | # op.c |
4438c4b7 |
370 | use warnings 'void' ; |
599cee73 |
371 | use Config ; |
372 | BEGIN { |
373 | if ( ! $Config{d_getppid}) { |
374 | print <<EOM ; |
375 | SKIPPED |
376 | # getppid not present |
377 | EOM |
378 | exit |
379 | } |
380 | } |
381 | getppid ; # OP_GETPPID |
4438c4b7 |
382 | no warnings 'void' ; |
0453d815 |
383 | getppid ; # OP_GETPPID |
599cee73 |
384 | EXPECT |
385 | Useless use of getppid in void context at - line 13. |
386 | ######## |
387 | # op.c |
4438c4b7 |
388 | use warnings 'void' ; |
599cee73 |
389 | use Config ; |
390 | BEGIN { |
391 | if ( ! $Config{d_getpgrp}) { |
392 | print <<EOM ; |
393 | SKIPPED |
394 | # getpgrp not present |
395 | EOM |
396 | exit |
397 | } |
398 | } |
399 | getpgrp ; # OP_GETPGRP |
4438c4b7 |
400 | no warnings 'void' ; |
0453d815 |
401 | getpgrp ; # OP_GETPGRP |
599cee73 |
402 | EXPECT |
403 | Useless use of getpgrp in void context at - line 13. |
404 | ######## |
405 | # op.c |
4438c4b7 |
406 | use warnings 'void' ; |
599cee73 |
407 | use Config ; |
408 | BEGIN { |
409 | if ( ! $Config{d_times}) { |
410 | print <<EOM ; |
411 | SKIPPED |
412 | # times not present |
413 | EOM |
414 | exit |
415 | } |
416 | } |
417 | times ; # OP_TMS |
4438c4b7 |
418 | no warnings 'void' ; |
0453d815 |
419 | times ; # OP_TMS |
599cee73 |
420 | EXPECT |
421 | Useless use of times in void context at - line 13. |
422 | ######## |
423 | # op.c |
4438c4b7 |
424 | use warnings 'void' ; |
599cee73 |
425 | use Config ; |
426 | BEGIN { |
e96326af |
427 | if ( ! $Config{d_getprior} or $^O eq 'os2') { # Locks before fixpak22 |
599cee73 |
428 | print <<EOM ; |
429 | SKIPPED |
430 | # getpriority not present |
431 | EOM |
432 | exit |
433 | } |
434 | } |
435 | getpriority 1,2; # OP_GETPRIORITY |
4438c4b7 |
436 | no warnings 'void' ; |
0453d815 |
437 | getpriority 1,2; # OP_GETPRIORITY |
599cee73 |
438 | EXPECT |
439 | Useless use of getpriority in void context at - line 13. |
440 | ######## |
441 | # op.c |
4438c4b7 |
442 | use warnings 'void' ; |
599cee73 |
443 | use Config ; |
444 | BEGIN { |
445 | if ( ! $Config{d_getlogin}) { |
446 | print <<EOM ; |
447 | SKIPPED |
448 | # getlogin not present |
449 | EOM |
450 | exit |
451 | } |
452 | } |
453 | getlogin ; # OP_GETLOGIN |
4438c4b7 |
454 | no warnings 'void' ; |
0453d815 |
455 | getlogin ; # OP_GETLOGIN |
599cee73 |
456 | EXPECT |
457 | Useless use of getlogin in void context at - line 13. |
458 | ######## |
459 | # op.c |
4438c4b7 |
460 | use warnings 'void' ; |
599cee73 |
461 | use Config ; BEGIN { |
462 | if ( ! $Config{d_socket}) { |
463 | print <<EOM ; |
464 | SKIPPED |
465 | # getsockname not present |
466 | # getpeername not present |
467 | # gethostbyname not present |
468 | # gethostbyaddr not present |
469 | # gethostent not present |
470 | # getnetbyname not present |
471 | # getnetbyaddr not present |
472 | # getnetent not present |
473 | # getprotobyname not present |
474 | # getprotobynumber not present |
475 | # getprotoent not present |
476 | # getservbyname not present |
477 | # getservbyport not present |
478 | # getservent not present |
479 | EOM |
480 | exit |
481 | } } |
482 | getsockname STDIN ; # OP_GETSOCKNAME |
483 | getpeername STDIN ; # OP_GETPEERNAME |
484 | gethostbyname 1 ; # OP_GHBYNAME |
485 | gethostbyaddr 1,2; # OP_GHBYADDR |
486 | gethostent ; # OP_GHOSTENT |
487 | getnetbyname 1 ; # OP_GNBYNAME |
488 | getnetbyaddr 1,2 ; # OP_GNBYADDR |
489 | getnetent ; # OP_GNETENT |
490 | getprotobyname 1; # OP_GPBYNAME |
491 | getprotobynumber 1; # OP_GPBYNUMBER |
492 | getprotoent ; # OP_GPROTOENT |
493 | getservbyname 1,2; # OP_GSBYNAME |
494 | getservbyport 1,2; # OP_GSBYPORT |
495 | getservent ; # OP_GSERVENT |
0453d815 |
496 | |
4438c4b7 |
497 | no warnings 'void' ; |
0453d815 |
498 | getsockname STDIN ; # OP_GETSOCKNAME |
499 | getpeername STDIN ; # OP_GETPEERNAME |
500 | gethostbyname 1 ; # OP_GHBYNAME |
501 | gethostbyaddr 1,2; # OP_GHBYADDR |
502 | gethostent ; # OP_GHOSTENT |
503 | getnetbyname 1 ; # OP_GNBYNAME |
504 | getnetbyaddr 1,2 ; # OP_GNBYADDR |
505 | getnetent ; # OP_GNETENT |
506 | getprotobyname 1; # OP_GPBYNAME |
507 | getprotobynumber 1; # OP_GPBYNUMBER |
508 | getprotoent ; # OP_GPROTOENT |
509 | getservbyname 1,2; # OP_GSBYNAME |
510 | getservbyport 1,2; # OP_GSBYPORT |
511 | getservent ; # OP_GSERVENT |
dfe13c55 |
512 | INIT { |
513 | # some functions may not be there, so we exit without running |
514 | exit; |
515 | } |
599cee73 |
516 | EXPECT |
517 | Useless use of getsockname in void context at - line 24. |
518 | Useless use of getpeername in void context at - line 25. |
519 | Useless use of gethostbyname in void context at - line 26. |
520 | Useless use of gethostbyaddr in void context at - line 27. |
521 | Useless use of gethostent in void context at - line 28. |
522 | Useless use of getnetbyname in void context at - line 29. |
523 | Useless use of getnetbyaddr in void context at - line 30. |
524 | Useless use of getnetent in void context at - line 31. |
525 | Useless use of getprotobyname in void context at - line 32. |
526 | Useless use of getprotobynumber in void context at - line 33. |
527 | Useless use of getprotoent in void context at - line 34. |
528 | Useless use of getservbyname in void context at - line 35. |
529 | Useless use of getservbyport in void context at - line 36. |
530 | Useless use of getservent in void context at - line 37. |
531 | ######## |
532 | # op.c |
4438c4b7 |
533 | use warnings 'void' ; |
599cee73 |
534 | *a ; # OP_RV2GV |
535 | $a ; # OP_RV2SV |
536 | @a ; # OP_RV2AV |
537 | %a ; # OP_RV2HV |
4438c4b7 |
538 | no warnings 'void' ; |
0453d815 |
539 | *a ; # OP_RV2GV |
540 | $a ; # OP_RV2SV |
541 | @a ; # OP_RV2AV |
542 | %a ; # OP_RV2HV |
599cee73 |
543 | EXPECT |
544 | Useless use of a variable in void context at - line 3. |
545 | Useless use of a variable in void context at - line 4. |
546 | Useless use of a variable in void context at - line 5. |
547 | Useless use of a variable in void context at - line 6. |
548 | ######## |
549 | # op.c |
4438c4b7 |
550 | use warnings 'void' ; |
599cee73 |
551 | "abc"; # OP_CONST |
552 | 7 ; # OP_CONST |
4438c4b7 |
553 | no warnings 'void' ; |
0453d815 |
554 | "abc"; # OP_CONST |
555 | 7 ; # OP_CONST |
599cee73 |
556 | EXPECT |
557 | Useless use of a constant in void context at - line 3. |
558 | Useless use of a constant in void context at - line 4. |
559 | ######## |
560 | # op.c |
98f7afd0 |
561 | BEGIN{ $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; } # known scalar leak |
e476b1b5 |
562 | use warnings 'misc' ; |
599cee73 |
563 | my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; |
564 | @a =~ /abc/ ; |
565 | @a =~ s/a/b/ ; |
566 | @a =~ tr/a/b/ ; |
567 | @$b =~ /abc/ ; |
568 | @$b =~ s/a/b/ ; |
569 | @$b =~ tr/a/b/ ; |
570 | %a =~ /abc/ ; |
571 | %a =~ s/a/b/ ; |
572 | %a =~ tr/a/b/ ; |
573 | %$c =~ /abc/ ; |
574 | %$c =~ s/a/b/ ; |
575 | %$c =~ tr/a/b/ ; |
0453d815 |
576 | { |
e476b1b5 |
577 | no warnings 'misc' ; |
0453d815 |
578 | my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; |
579 | @a =~ /abc/ ; |
580 | @a =~ s/a/b/ ; |
581 | @a =~ tr/a/b/ ; |
582 | @$b =~ /abc/ ; |
583 | @$b =~ s/a/b/ ; |
584 | @$b =~ tr/a/b/ ; |
585 | %a =~ /abc/ ; |
586 | %a =~ s/a/b/ ; |
587 | %a =~ tr/a/b/ ; |
588 | %$c =~ /abc/ ; |
589 | %$c =~ s/a/b/ ; |
590 | %$c =~ tr/a/b/ ; |
591 | } |
599cee73 |
592 | EXPECT |
42d38218 |
593 | Applying pattern match (m//) to @array will act on scalar(@array) at - line 5. |
594 | Applying substitution (s///) to @array will act on scalar(@array) at - line 6. |
595 | Can't modify private array in substitution (s///) at - line 6, near "s/a/b/ ;" |
f1612b5c |
596 | Applying transliteration (tr///) to @array will act on scalar(@array) at - line 7. |
42d38218 |
597 | Applying pattern match (m//) to @array will act on scalar(@array) at - line 8. |
598 | Applying substitution (s///) to @array will act on scalar(@array) at - line 9. |
f1612b5c |
599 | Applying transliteration (tr///) to @array will act on scalar(@array) at - line 10. |
42d38218 |
600 | Applying pattern match (m//) to %hash will act on scalar(%hash) at - line 11. |
601 | Applying substitution (s///) to %hash will act on scalar(%hash) at - line 12. |
f1612b5c |
602 | Applying transliteration (tr///) to %hash will act on scalar(%hash) at - line 13. |
42d38218 |
603 | Applying pattern match (m//) to %hash will act on scalar(%hash) at - line 14. |
604 | Applying substitution (s///) to %hash will act on scalar(%hash) at - line 15. |
f1612b5c |
605 | Applying transliteration (tr///) to %hash will act on scalar(%hash) at - line 16. |
f248d071 |
606 | BEGIN not safe after errors--compilation aborted at - line 18. |
599cee73 |
607 | ######## |
608 | # op.c |
4438c4b7 |
609 | use warnings 'syntax' ; |
599cee73 |
610 | my $a, $b = (1,2); |
4438c4b7 |
611 | no warnings 'syntax' ; |
0453d815 |
612 | my $c, $d = (1,2); |
599cee73 |
613 | EXPECT |
df5b6949 |
614 | Parentheses missing around "my" list at - line 3. |
599cee73 |
615 | ######## |
616 | # op.c |
4438c4b7 |
617 | use warnings 'syntax' ; |
599cee73 |
618 | local $a, $b = (1,2); |
4438c4b7 |
619 | no warnings 'syntax' ; |
0453d815 |
620 | local $c, $d = (1,2); |
599cee73 |
621 | EXPECT |
df5b6949 |
622 | Parentheses missing around "local" list at - line 3. |
599cee73 |
623 | ######## |
624 | # op.c |
e476b1b5 |
625 | use warnings 'bareword' ; |
599cee73 |
626 | print (ABC || 1) ; |
e476b1b5 |
627 | no warnings 'bareword' ; |
0453d815 |
628 | print (ABC || 1) ; |
599cee73 |
629 | EXPECT |
34d09196 |
630 | Bareword found in conditional at - line 3. |
599cee73 |
631 | ######## |
632 | --FILE-- abc |
633 | |
634 | --FILE-- |
635 | # op.c |
e476b1b5 |
636 | use warnings 'misc' ; |
599cee73 |
637 | open FH, "<abc" ; |
638 | $x = 1 if $x = <FH> ; |
e476b1b5 |
639 | no warnings 'misc' ; |
0453d815 |
640 | $x = 1 if $x = <FH> ; |
599cee73 |
641 | EXPECT |
642 | Value of <HANDLE> construct can be "0"; test with defined() at - line 4. |
643 | ######## |
644 | # op.c |
e476b1b5 |
645 | use warnings 'misc' ; |
599cee73 |
646 | opendir FH, "." ; |
647 | $x = 1 if $x = readdir FH ; |
e476b1b5 |
648 | no warnings 'misc' ; |
0453d815 |
649 | $x = 1 if $x = readdir FH ; |
599cee73 |
650 | closedir FH ; |
651 | EXPECT |
652 | Value of readdir() operator can be "0"; test with defined() at - line 4. |
653 | ######## |
654 | # op.c |
e476b1b5 |
655 | use warnings 'misc' ; |
599cee73 |
656 | $x = 1 if $x = <*> ; |
e476b1b5 |
657 | no warnings 'misc' ; |
0453d815 |
658 | $x = 1 if $x = <*> ; |
599cee73 |
659 | EXPECT |
660 | Value of glob construct can be "0"; test with defined() at - line 3. |
661 | ######## |
662 | # op.c |
e476b1b5 |
663 | use warnings 'misc' ; |
599cee73 |
664 | %a = (1,2,3,4) ; |
665 | $x = 1 if $x = each %a ; |
e476b1b5 |
666 | no warnings 'misc' ; |
0453d815 |
667 | $x = 1 if $x = each %a ; |
599cee73 |
668 | EXPECT |
669 | Value of each() operator can be "0"; test with defined() at - line 4. |
670 | ######## |
671 | # op.c |
e476b1b5 |
672 | use warnings 'misc' ; |
599cee73 |
673 | $x = 1 while $x = <*> and 0 ; |
e476b1b5 |
674 | no warnings 'misc' ; |
0453d815 |
675 | $x = 1 while $x = <*> and 0 ; |
599cee73 |
676 | EXPECT |
677 | Value of glob construct can be "0"; test with defined() at - line 3. |
678 | ######## |
679 | # op.c |
e476b1b5 |
680 | use warnings 'misc' ; |
599cee73 |
681 | opendir FH, "." ; |
682 | $x = 1 while $x = readdir FH and 0 ; |
e476b1b5 |
683 | no warnings 'misc' ; |
0453d815 |
684 | $x = 1 while $x = readdir FH and 0 ; |
599cee73 |
685 | closedir FH ; |
686 | EXPECT |
687 | Value of readdir() operator can be "0"; test with defined() at - line 4. |
688 | ######## |
689 | # op.c |
4438c4b7 |
690 | use warnings 'redefine' ; |
599cee73 |
691 | sub fred {} |
692 | sub fred {} |
4438c4b7 |
693 | no warnings 'redefine' ; |
0453d815 |
694 | sub fred {} |
599cee73 |
695 | EXPECT |
696 | Subroutine fred redefined at - line 4. |
697 | ######## |
698 | # op.c |
4438c4b7 |
699 | use warnings 'redefine' ; |
599cee73 |
700 | sub fred () { 1 } |
701 | sub fred () { 1 } |
4438c4b7 |
702 | no warnings 'redefine' ; |
0453d815 |
703 | sub fred () { 1 } |
599cee73 |
704 | EXPECT |
705 | Constant subroutine fred redefined at - line 4. |
706 | ######## |
707 | # op.c |
4438c4b7 |
708 | use warnings 'redefine' ; |
599cee73 |
709 | format FRED = |
710 | . |
711 | format FRED = |
712 | . |
4438c4b7 |
713 | no warnings 'redefine' ; |
0453d815 |
714 | format FRED = |
715 | . |
599cee73 |
716 | EXPECT |
717 | Format FRED redefined at - line 5. |
718 | ######## |
719 | # op.c |
e476b1b5 |
720 | use warnings 'deprecated' ; |
599cee73 |
721 | push FRED; |
e476b1b5 |
722 | no warnings 'deprecated' ; |
0453d815 |
723 | push FRED; |
599cee73 |
724 | EXPECT |
725 | Array @FRED missing the @ in argument 1 of push() at - line 3. |
726 | ######## |
727 | # op.c |
e476b1b5 |
728 | use warnings 'deprecated' ; |
599cee73 |
729 | @a = keys FRED ; |
e476b1b5 |
730 | no warnings 'deprecated' ; |
0453d815 |
731 | @a = keys FRED ; |
599cee73 |
732 | EXPECT |
733 | Hash %FRED missing the % in argument 1 of keys() at - line 3. |
734 | ######## |
735 | # op.c |
4438c4b7 |
736 | use warnings 'syntax' ; |
dfe13c55 |
737 | exec "$^X -e 1" ; |
599cee73 |
738 | my $a |
739 | EXPECT |
740 | Statement unlikely to be reached at - line 4. |
741 | (Maybe you meant system() when you said exec()?) |
69794302 |
742 | ######## |
743 | # op.c |
4438c4b7 |
744 | use warnings 'deprecated' ; |
69794302 |
745 | my @a; defined(@a); |
746 | EXPECT |
f10b0346 |
747 | defined(@array) is deprecated at - line 3. |
69794302 |
748 | (Maybe you should just omit the defined()?) |
749 | ######## |
750 | # op.c |
4438c4b7 |
751 | use warnings 'deprecated' ; |
69794302 |
752 | defined(@a = (1,2,3)); |
753 | EXPECT |
f10b0346 |
754 | defined(@array) is deprecated at - line 3. |
69794302 |
755 | (Maybe you should just omit the defined()?) |
756 | ######## |
757 | # op.c |
4438c4b7 |
758 | use warnings 'deprecated' ; |
69794302 |
759 | my %h; defined(%h); |
760 | EXPECT |
f10b0346 |
761 | defined(%hash) is deprecated at - line 3. |
69794302 |
762 | (Maybe you should just omit the defined()?) |
0453d815 |
763 | ######## |
764 | # op.c |
4438c4b7 |
765 | no warnings 'syntax' ; |
0453d815 |
766 | exec "$^X -e 1" ; |
767 | my $a |
768 | EXPECT |
769 | |
770 | ######## |
771 | # op.c |
772 | sub fred(); |
773 | sub fred($) {} |
774 | EXPECT |
775 | Prototype mismatch: sub main::fred () vs ($) at - line 3. |
776 | ######## |
777 | # op.c |
778 | $^W = 0 ; |
779 | sub fred() ; |
780 | sub fred($) {} |
781 | { |
e476b1b5 |
782 | no warnings 'prototype' ; |
0453d815 |
783 | sub Fred() ; |
784 | sub Fred($) {} |
e476b1b5 |
785 | use warnings 'prototype' ; |
0453d815 |
786 | sub freD() ; |
787 | sub freD($) {} |
788 | } |
789 | sub FRED() ; |
790 | sub FRED($) {} |
791 | EXPECT |
792 | Prototype mismatch: sub main::fred () vs ($) at - line 4. |
793 | Prototype mismatch: sub main::freD () vs ($) at - line 11. |
794 | Prototype mismatch: sub main::FRED () vs ($) at - line 14. |
eb6e2d6f |
795 | ######## |
796 | # op.c |
797 | use warnings 'syntax' ; |
798 | join /---/, 'x', 'y', 'z'; |
799 | EXPECT |
800 | /---/ should probably be written as "---" at - line 3. |
767a6a26 |
801 | ######## |
802 | # op.c [Perl_peep] |
e476b1b5 |
803 | use warnings 'prototype' ; |
767a6a26 |
804 | fred() ; |
805 | sub fred ($$) {} |
e476b1b5 |
806 | no warnings 'prototype' ; |
767a6a26 |
807 | joe() ; |
808 | sub joe ($$) {} |
809 | EXPECT |
810 | main::fred() called too early to check prototype at - line 3. |