3 Found = in conditional, should be ==
6 Useless use of time in void context
7 Useless use of a variable in void context
8 Useless use of a constant in void context
13 Useless use of sort in scalar context
16 Applying %s to %s will act on scalar(%s)
17 my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
32 Parentheses missing around "my" list at -e line 1.
35 Parentheses missing around "local" list at -e line 1.
38 Bareword found in conditional at -e line 1.
39 use warnings 'bareword'; my $x = print(ABC || 1);
41 Value of %s may be \"0\"; use \"defined\"
43 $x = 1 while $x = <FH> ;
45 Subroutine fred redefined at -e line 1.
46 sub fred{1;} sub fred{1;}
48 Constant subroutine %s redefined
49 sub fred() {1;} sub fred() {1;}
51 Format FRED redefined at /tmp/x line 5.
57 Array @%s missing the @ in argument %d of %s()
60 Hash %%%s missing the %% in argument %d of %s()
63 Statement unlikely to be reached
64 (Maybe you meant system() when you said exec()?
67 defined(@array) is deprecated
68 (Maybe you should just omit the defined()?)
70 defined (@a = (1,2,3)) ;
72 defined(%hash) is deprecated
73 (Maybe you should just omit the defined()?)
76 "my %s" used in sort comparison
78 $[ used in comparison (did you mean $] ?)
80 length() used on @array (did you mean "scalar(@array)"?)
81 length() used on %hash (did you mean "scalar(keys %hash)"?)
83 /---/ should probably be written as "---"
86 %s() called too early to check prototype [Perl_peep]
87 fred() ; sub fred ($$) {}
90 Package '%s' not found (did you use the incorrect case?)
92 Use of /g modifier is meaningless in split
94 Possible precedence problem on bitwise %c operator [Perl_ck_bitop]
98 Prototype mismatch: [cv_ckproto]
102 oops: oopsAV [oopsAV] TODO
103 oops: oopsHV [oopsHV] TODO
107 use warnings 'syntax' ;
111 no warnings 'syntax' ;
116 Found = in conditional, should be == at - line 3.
117 Found = in conditional, should be == at - line 4.
120 use warnings 'syntax' ;
121 use constant foo => 1;
123 no warnings 'syntax' ;
133 $main::foo = {}; %$main::foo->{"bar"};
134 $foo = {}; %$foo->{"bar"};
135 $main::foo = []; @$main::foo->[34];
136 $foo = []; @$foo->[34];
137 no warnings 'deprecated';
142 $main::foo = {}; %$main::foo->{"bar"};
143 $foo = {}; %$foo->{"bar"};
144 $main::foo = []; @$main::foo->[34];
145 $foo = []; @$foo->[34];
147 Using a hash as a reference is deprecated at - line 3.
148 Using a hash as a reference is deprecated at - line 4.
149 Using an array as a reference is deprecated at - line 5.
150 Using an array as a reference is deprecated at - line 6.
151 Using a hash as a reference is deprecated at - line 7.
152 Using a hash as a reference is deprecated at - line 8.
153 Using an array as a reference is deprecated at - line 9.
154 Using an array as a reference is deprecated at - line 10.
157 use warnings 'void' ; close STDIN ;
159 1 x 3 ; # OP_REPEAT (folded)
160 (1) x 3 ; # OP_REPEAT
162 wantarray ; # OP_WANTARRAY
172 defined $a ; # OP_DEFINED
175 length $a ; # OP_LENGTH
176 substr $a,1 ; # OP_SUBSTR
177 vec $a,1,2 ; # OP_VEC
178 index $a,1,2 ; # OP_INDEX
179 rindex $a,1,2 ; # OP_RINDEX
180 sprintf $a ; # OP_SPRINTF
184 #values %a ; # OP_VALUES
188 unpack "a", "a" ; # OP_UNPACK
189 pack $a,"" ; # OP_PACK
191 (@a)[0,1] ; # OP_LSLICE
194 sort(1,2) ; # OP_SORT
195 reverse(1,2) ; # OP_REVERSE
200 fileno STDIN ; # OP_FILENO
202 tell STDIN ; # OP_TELL
203 readlink 1; # OP_READLINK
205 localtime ; # OP_LOCALTIME
207 eval { getgrnam 1 }; # OP_GGRNAM
208 eval { getgrgid 1 }; # OP_GGRGID
209 eval { getpwnam 1 }; # OP_GPWNAM
210 eval { getpwuid 1 }; # OP_GPWUID
211 prototype "foo"; # OP_PROTOTYPE
212 $a ~~ $b; # OP_SMARTMATCH
217 Useless use of a constant ("111") in void context at - line 2.
218 Useless use of repeat (x) in void context at - line 3.
219 Useless use of wantarray in void context at - line 5.
220 Useless use of reference-type operator in void context at - line 12.
221 Useless use of reference constructor in void context at - line 13.
222 Useless use of single ref constructor in void context at - line 14.
223 Useless use of defined operator in void context at - line 15.
224 Useless use of hex in void context at - line 16.
225 Useless use of oct in void context at - line 17.
226 Useless use of length in void context at - line 18.
227 Useless use of substr in void context at - line 19.
228 Useless use of vec in void context at - line 20.
229 Useless use of index in void context at - line 21.
230 Useless use of rindex in void context at - line 22.
231 Useless use of sprintf in void context at - line 23.
232 Useless use of array element in void context at - line 24.
233 Useless use of array slice in void context at - line 26.
234 Useless use of hash element in void context at - line 29.
235 Useless use of hash slice in void context at - line 30.
236 Useless use of unpack in void context at - line 31.
237 Useless use of pack in void context at - line 32.
238 Useless use of join or string in void context at - line 33.
239 Useless use of list slice in void context at - line 34.
240 Useless use of sort in void context at - line 37.
241 Useless use of reverse in void context at - line 38.
242 Useless use of range (or flop) in void context at - line 41.
243 Useless use of caller in void context at - line 42.
244 Useless use of fileno in void context at - line 43.
245 Useless use of eof in void context at - line 44.
246 Useless use of tell in void context at - line 45.
247 Useless use of readlink in void context at - line 46.
248 Useless use of time in void context at - line 47.
249 Useless use of localtime in void context at - line 48.
250 Useless use of gmtime in void context at - line 49.
251 Useless use of getgrnam in void context at - line 50.
252 Useless use of getgrgid in void context at - line 51.
253 Useless use of getpwnam in void context at - line 52.
254 Useless use of getpwuid in void context at - line 53.
255 Useless use of subroutine prototype in void context at - line 54.
256 Useless use of smart match in void context at - line 55.
257 Useless use of numeric comparison (<=>) in void context at - line 56.
258 Useless use of __SUB__ in void context at - line 58.
261 use warnings 'void' ; close STDIN ;
262 my $x = sort (2,1,3);
266 Useless use of sort in scalar context at - line 3.
269 no warnings 'void' ; close STDIN ;
272 wantarray ; # OP_WANTARRAY
282 defined $a ; # OP_DEFINED
285 length $a ; # OP_LENGTH
286 substr $a,1 ; # OP_SUBSTR
287 vec $a,1,2 ; # OP_VEC
288 index $a,1,2 ; # OP_INDEX
289 rindex $a,1,2 ; # OP_RINDEX
290 sprintf $a ; # OP_SPRINTF
294 #values %a ; # OP_VALUES
298 unpack "a", "a" ; # OP_UNPACK
299 pack $a,"" ; # OP_PACK
301 (@a)[0,1] ; # OP_LSLICE
304 sort(1,2) ; # OP_SORT
305 reverse(1,2) ; # OP_REVERSE
310 fileno STDIN ; # OP_FILENO
312 tell STDIN ; # OP_TELL
313 readlink 1; # OP_READLINK
315 localtime ; # OP_LOCALTIME
317 eval { getgrnam 1 }; # OP_GGRNAM
318 eval { getgrgid 1 }; # OP_GGRGID
319 eval { getpwnam 1 }; # OP_GPWNAM
320 eval { getpwuid 1 }; # OP_GPWUID
321 prototype "foo"; # OP_PROTOTYPE
325 use warnings 'void' ;
326 for (@{[0]}) { "$_" } # check warning isn't duplicated
328 for (@{[0]}) { "$_" } # check warning isn't duplicated
330 Useless use of string in void context at - line 3.
333 use warnings 'void' ;
336 if ( ! $Config{d_telldir}) {
339 # telldir not present
344 telldir 1 ; # OP_TELLDIR
346 telldir 1 ; # OP_TELLDIR
348 Useless use of telldir in void context at - line 13.
351 use warnings 'void' ;
354 if ( ! $Config{d_getppid}) {
357 # getppid not present
362 getppid ; # OP_GETPPID
364 getppid ; # OP_GETPPID
366 Useless use of getppid in void context at - line 13.
369 use warnings 'void' ;
372 if ( ! $Config{d_getpgrp}) {
375 # getpgrp not present
380 getpgrp ; # OP_GETPGRP
382 getpgrp ; # OP_GETPGRP
384 Useless use of getpgrp in void context at - line 13.
387 use warnings 'void' ;
390 if ( ! $Config{d_times}) {
402 Useless use of times in void context at - line 13.
405 use warnings 'void' ;
408 if ( ! $Config{d_getprior} or $^O eq 'os2') { # Locks before fixpak22
411 # getpriority not present
416 getpriority 1,2; # OP_GETPRIORITY
418 getpriority 1,2; # OP_GETPRIORITY
420 Useless use of getpriority in void context at - line 13.
423 use warnings 'void' ;
426 if ( ! $Config{d_getlogin}) {
429 # getlogin not present
434 getlogin ; # OP_GETLOGIN
436 getlogin ; # OP_GETLOGIN
438 Useless use of getlogin in void context at - line 13.
441 use warnings 'void' ;
443 if ( ! $Config{d_socket}) {
446 # getsockname not present
447 # getpeername not present
448 # gethostbyname not present
449 # gethostbyaddr not present
450 # gethostent not present
451 # getnetbyname not present
452 # getnetbyaddr not present
453 # getnetent not present
454 # getprotobyname not present
455 # getprotobynumber not present
456 # getprotoent not present
457 # getservbyname not present
458 # getservbyport not present
459 # getservent not present
463 getsockname STDIN ; # OP_GETSOCKNAME
464 getpeername STDIN ; # OP_GETPEERNAME
465 gethostbyname 1 ; # OP_GHBYNAME
466 gethostbyaddr 1,2; # OP_GHBYADDR
467 gethostent ; # OP_GHOSTENT
468 getnetbyname 1 ; # OP_GNBYNAME
469 getnetbyaddr 1,2 ; # OP_GNBYADDR
470 getnetent ; # OP_GNETENT
471 getprotobyname 1; # OP_GPBYNAME
472 getprotobynumber 1; # OP_GPBYNUMBER
473 getprotoent ; # OP_GPROTOENT
474 getservbyname 1,2; # OP_GSBYNAME
475 getservbyport 1,2; # OP_GSBYPORT
476 getservent ; # OP_GSERVENT
479 getsockname STDIN ; # OP_GETSOCKNAME
480 getpeername STDIN ; # OP_GETPEERNAME
481 gethostbyname 1 ; # OP_GHBYNAME
482 gethostbyaddr 1,2; # OP_GHBYADDR
483 gethostent ; # OP_GHOSTENT
484 getnetbyname 1 ; # OP_GNBYNAME
485 getnetbyaddr 1,2 ; # OP_GNBYADDR
486 getnetent ; # OP_GNETENT
487 getprotobyname 1; # OP_GPBYNAME
488 getprotobynumber 1; # OP_GPBYNUMBER
489 getprotoent ; # OP_GPROTOENT
490 getservbyname 1,2; # OP_GSBYNAME
491 getservbyport 1,2; # OP_GSBYPORT
492 getservent ; # OP_GSERVENT
494 # some functions may not be there, so we exit without running
498 Useless use of getsockname in void context at - line 24.
499 Useless use of getpeername in void context at - line 25.
500 Useless use of gethostbyname in void context at - line 26.
501 Useless use of gethostbyaddr in void context at - line 27.
502 Useless use of gethostent in void context at - line 28.
503 Useless use of getnetbyname in void context at - line 29.
504 Useless use of getnetbyaddr in void context at - line 30.
505 Useless use of getnetent in void context at - line 31.
506 Useless use of getprotobyname in void context at - line 32.
507 Useless use of getprotobynumber in void context at - line 33.
508 Useless use of getprotoent in void context at - line 34.
509 Useless use of getservbyname in void context at - line 35.
510 Useless use of getservbyport in void context at - line 36.
511 Useless use of getservent in void context at - line 37.
514 use warnings 'void' ;
525 Useless use of a variable in void context at - line 3.
526 Useless use of a variable in void context at - line 4.
527 Useless use of a variable in void context at - line 5.
528 Useless use of a variable in void context at - line 6.
531 use warnings 'void' ;
534 "x" . "y"; # optimized to OP_CONST
535 2 + 2; # optimized to OP_CONST
536 use constant U => undef;
539 5 || print "bad\n"; # test OPpCONST_SHORTCIRCUIT
540 print "boo\n" if U; # test OPpCONST_SHORTCIRCUIT
544 "x" . "y"; # optimized to OP_CONST
545 2 + 2; # optimized to OP_CONST
547 Useless use of a constant ("abc") in void context at - line 3.
548 Useless use of a constant (7) in void context at - line 4.
549 Useless use of a constant ("xy") in void context at - line 5.
550 Useless use of a constant (4) in void context at - line 6.
551 Useless use of a constant (undef) in void context at - line 8.
552 Useless use of a constant ("\"\t\n") in void context at - line 9.
556 use open qw( :utf8 :std );
557 use warnings 'void' ;
559 "Ẋ" . "ƴ"; # optimized to OP_CONST
560 FOO; # Bareword optimized to OP_CONST
561 use constant ů => undef;
563 5 || print "bad\n"; # test OPpCONST_SHORTCIRCUIT
564 print "boo\n" if ů; # test OPpCONST_SHORTCIRCUIT
567 "Ẋ" . "ƴ"; # optimized to OP_CONST
569 Useless use of a constant ("\340\x{1e06}c") in void context at - line 5.
570 Useless use of a constant ("\x{1e8a}\x{1b4}") in void context at - line 6.
571 Useless use of a constant ("\x{ff26}\x{ff2f}\x{ff2f}") in void context at - line 7.
572 Useless use of a constant (undef) in void context at - line 9.
576 use warnings 'misc' ;
577 my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;my $d = 'test';
594 my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; my $d = 'test';
611 Applying pattern match (m//) to @a will act on scalar(@a) at - line 5.
612 Applying substitution (s///) to @a2 will act on scalar(@a2) at - line 6.
613 Applying transliteration (tr///) to @a3 will act on scalar(@a3) at - line 7.
614 Applying pattern match (m//) to @array will act on scalar(@array) at - line 8.
615 Applying substitution (s///) to @array will act on scalar(@array) at - line 9.
616 Applying transliteration (tr///) to @array will act on scalar(@array) at - line 10.
617 Applying pattern match (m//) to %a will act on scalar(%a) at - line 11.
618 Applying substitution (s///) to %a2 will act on scalar(%a2) at - line 12.
619 Applying transliteration (tr///) to %a3 will act on scalar(%a3) at - line 13.
620 Applying pattern match (m//) to %hash will act on scalar(%hash) at - line 14.
621 Applying substitution (s///) to %hash will act on scalar(%hash) at - line 15.
622 Applying transliteration (tr///) to %hash will act on scalar(%hash) at - line 16.
623 Useless use of /d modifier in transliteration operator at - line 17.
624 Replacement list is longer than search list at - line 18.
625 Can't modify array dereference in substitution (s///) at - line 6, near "s/a/b/ ;"
626 BEGIN not safe after errors--compilation aborted at - line 20.
629 use warnings 'parenthesis' ;
631 my @foo,%bar, $quux; # there's a TAB here
633 no warnings 'parenthesis' ;
636 Parentheses missing around "my" list at - line 3.
637 Parentheses missing around "my" list at - line 4.
640 use warnings 'parenthesis' ;
642 no warnings 'parenthesis' ;
645 Parentheses missing around "our" list at - line 3.
648 use warnings 'parenthesis' ;
649 local $a, $b = (1,2);
651 no warnings 'parenthesis' ;
652 local $c, $d = (1,2);
654 Parentheses missing around "local" list at - line 3.
655 Parentheses missing around "local" list at - line 4.
658 use warnings 'bareword' ;
660 no warnings 'bareword' ;
663 Bareword found in conditional at - line 3.
669 use warnings 'misc' ;
671 $x = 1 if $x = <FH> ;
675 $x = 1 if $x = <FH> ;
679 Value of <HANDLE> construct can be "0"; test with defined() at - line 4.
680 Value of <HANDLE> construct can be "0"; test with defined() at - line 5.
683 use warnings 'misc' ;
685 $x = 1 if $x = readdir FH ;
689 $x = 1 if $x = readdir FH ;
694 Value of readdir() operator can be "0"; test with defined() at - line 4.
695 Value of readdir() operator can be "0"; test with defined() at - line 5.
698 use warnings 'misc' ;
707 Value of glob construct can be "0"; test with defined() at - line 3.
708 Value of glob construct can be "0"; test with defined() at - line 4.
711 use warnings 'misc' ;
713 $x = 1 if $x = each %a ;
715 $x = 1 if $x = each %a ;
717 Value of each() operator can be "0"; test with defined() at - line 4.
720 use warnings 'misc' ;
721 $x = 1 while $x = <*> and 0 ;
723 $x = 1 while $x = <*> and 0 ;
725 Value of glob construct can be "0"; test with defined() at - line 3.
728 use warnings 'misc' ;
730 $x = 1 while $x = readdir FH and 0 ;
732 $x = 1 while $x = readdir FH and 0 ;
735 Value of readdir() operator can be "0"; test with defined() at - line 4.
740 ($_ = <FH>) // ($_ = 1);
746 use warnings 'redefine' ;
749 sub fred { # warning should be for this line
751 no warnings 'redefine' ;
756 Subroutine fred redefined at - line 4.
757 Subroutine fred redefined at - line 5.
760 use warnings 'redefine' ;
763 no warnings 'redefine' ;
766 Constant subroutine fred redefined at - line 4.
772 Constant subroutine fred redefined at - line 3.
776 *fred = sub () { 2 };
778 Constant subroutine main::fred redefined at - line 3.
781 use feature "lexical_subs", "state";
785 sub george () { 2 } # should *not* produce redef warnings by default
786 state sub phred () { 1 }
788 state sub jorge { 1 }
789 sub jorge () { 2 } # should *not* produce redef warnings by default
791 The lexical_subs feature is experimental at - line 2.
792 Prototype mismatch: sub fred () vs none at - line 4.
793 Constant subroutine fred redefined at - line 4.
794 Prototype mismatch: sub george: none vs () at - line 6.
795 Prototype mismatch: sub phred () vs none at - line 8.
796 Constant subroutine phred redefined at - line 8.
797 Prototype mismatch: sub jorge: none vs () at - line 10.
800 no warnings 'redefine' ;
806 no warnings 'redefine' ;
808 *fred = sub () { 2 };
812 use warnings 'redefine' ;
817 no warnings 'redefine' ;
821 Format FRED redefined at - line 5.
825 no warnings 'deprecated' ;
828 Array @FRED missing the @ in argument 1 of push() at - line 2.
832 no warnings 'deprecated' ;
835 Hash %FRED missing the % in argument 1 of keys() at - line 2.
838 use warnings 'syntax' ;
842 Statement unlikely to be reached at - line 4.
843 (Maybe you meant system() when you said exec()?)
845 # op.c, no warning if exec isn't a statement.
846 use warnings 'syntax' ;
847 $a || exec "$^X -e 1" ;
854 defined(@array) is deprecated at - line 2.
855 (Maybe you should just omit the defined()?)
860 defined(@array) is deprecated at - line 2.
861 (Maybe you should just omit the defined()?)
864 defined(@a = (1,2,3));
866 defined(@array) is deprecated at - line 2.
867 (Maybe you should just omit the defined()?)
872 defined(%hash) is deprecated at - line 2.
873 (Maybe you should just omit the defined()?)
878 defined(%hash) is deprecated at - line 2.
879 (Maybe you should just omit the defined()?)
882 no warnings 'syntax' ;
891 use constant foo=>bar; sub foo(@);
892 use constant bav=>bar; sub bav(); # no warning
895 Prototype mismatch: sub main::fred () vs ($) at - line 3.
896 Prototype mismatch: sub foo () vs (@) at - line 4.
897 Prototype mismatch: sub btu: none vs () at - line 6.
901 use open qw( :utf8 :std );
905 Prototype mismatch: sub main::frèd () vs ($) at - line 5.
909 use open qw( :utf8 :std );
911 eval "sub fòò (\$\0) {}";
913 Illegal character in prototype for main::fòò : $\0 at (eval 1) line 1.
917 use open qw( :utf8 :std );
919 eval "sub foo (\0) {}";
921 Illegal character in prototype for main::foo : \0 at (eval 1) line 1.
925 use open qw( :utf8 :std );
927 BEGIN { $::{"foo"} = "\$\0L\351on" }
928 BEGIN { eval "sub foo (\$\0L\x{c3}\x{a9}on) {}"; }
930 Illegal character in prototype for main::foo : $\x{0}L... at (eval 1) line 1.
934 use open qw( :utf8 :std );
936 BEGIN { eval "sub foo (\0) {}"; }
938 Illegal character in prototype for main::foo : \0 at (eval 1) line 1.
942 eval "sub foo (\xAB) {}";
944 Illegal character in prototype for main::foo : \x{ab} at (eval 1) line 1.
948 use open qw( :utf8 :std );
950 BEGIN { eval "sub foo (\x{30cb}) {}"; }
952 Illegal character in prototype for main::foo : \x{30cb} at (eval 1) line 1.
956 use open qw( :utf8 :std );
958 BEGIN { $::{"foo"} = "\x{30cb}" }
959 BEGIN { eval "sub foo {}"; }
961 Prototype mismatch: sub main::foo (ニ) vs none at (eval 1) line 1.
968 no warnings 'prototype' ;
971 use warnings 'prototype' ;
978 Prototype mismatch: sub main::fred () vs ($) at - line 4.
979 Prototype mismatch: sub main::freD () vs ($) at - line 11.
980 Prototype mismatch: sub main::FRED () vs ($) at - line 14.
982 # op.c [S_simplify_sort]
984 my @tests = split /^/, '
987 { use integer; sort {$a <=> $b} @a}
990 { use integer; sort {$b <=> $a} @a}
992 for my $pragma ('use warnings "syntax";', '') {
993 for my $vars ('', 'my $a;', 'my $b;', 'my ($a,$b);') {
994 for my $inner_stmt ('', 'print;', 'func();') {
995 eval "#line " . ++$line . "01 -\n$pragma\n$vars"
996 . join "", map s/sort \{\K/$inner_stmt/r, @tests;
1002 use warnings 'syntax';
1004 # These used to be errors!
1005 sort { ; } $a <=> $b;
1006 sort { ; } $a, "<=>";
1007 sort { ; } $a, $cmp;
1008 sort $a, $b if $cmpany_name;
1012 "my $a" used in sort comparison at - line 403.
1013 "my $a" used in sort comparison at - line 404.
1014 "my $a" used in sort comparison at - line 405.
1015 "my $a" used in sort comparison at - line 406.
1016 "my $a" used in sort comparison at - line 407.
1017 "my $a" used in sort comparison at - line 408.
1018 "my $a" used in sort comparison at - line 503.
1019 "my $a" used in sort comparison at - line 504.
1020 "my $a" used in sort comparison at - line 505.
1021 "my $a" used in sort comparison at - line 506.
1022 "my $a" used in sort comparison at - line 507.
1023 "my $a" used in sort comparison at - line 508.
1024 "my $a" used in sort comparison at - line 603.
1025 "my $a" used in sort comparison at - line 604.
1026 "my $a" used in sort comparison at - line 605.
1027 "my $a" used in sort comparison at - line 606.
1028 "my $a" used in sort comparison at - line 607.
1029 "my $a" used in sort comparison at - line 608.
1030 "my $b" used in sort comparison at - line 703.
1031 "my $b" used in sort comparison at - line 704.
1032 "my $b" used in sort comparison at - line 705.
1033 "my $b" used in sort comparison at - line 706.
1034 "my $b" used in sort comparison at - line 707.
1035 "my $b" used in sort comparison at - line 708.
1036 "my $b" used in sort comparison at - line 803.
1037 "my $b" used in sort comparison at - line 804.
1038 "my $b" used in sort comparison at - line 805.
1039 "my $b" used in sort comparison at - line 806.
1040 "my $b" used in sort comparison at - line 807.
1041 "my $b" used in sort comparison at - line 808.
1042 "my $b" used in sort comparison at - line 903.
1043 "my $b" used in sort comparison at - line 904.
1044 "my $b" used in sort comparison at - line 905.
1045 "my $b" used in sort comparison at - line 906.
1046 "my $b" used in sort comparison at - line 907.
1047 "my $b" used in sort comparison at - line 908.
1048 "my $a" used in sort comparison at - line 1003.
1049 "my $b" used in sort comparison at - line 1003.
1050 "my $a" used in sort comparison at - line 1004.
1051 "my $b" used in sort comparison at - line 1004.
1052 "my $a" used in sort comparison at - line 1005.
1053 "my $b" used in sort comparison at - line 1005.
1054 "my $b" used in sort comparison at - line 1006.
1055 "my $a" used in sort comparison at - line 1006.
1056 "my $b" used in sort comparison at - line 1007.
1057 "my $a" used in sort comparison at - line 1007.
1058 "my $b" used in sort comparison at - line 1008.
1059 "my $a" used in sort comparison at - line 1008.
1060 "my $a" used in sort comparison at - line 1103.
1061 "my $b" used in sort comparison at - line 1103.
1062 "my $a" used in sort comparison at - line 1104.
1063 "my $b" used in sort comparison at - line 1104.
1064 "my $a" used in sort comparison at - line 1105.
1065 "my $b" used in sort comparison at - line 1105.
1066 "my $b" used in sort comparison at - line 1106.
1067 "my $a" used in sort comparison at - line 1106.
1068 "my $b" used in sort comparison at - line 1107.
1069 "my $a" used in sort comparison at - line 1107.
1070 "my $b" used in sort comparison at - line 1108.
1071 "my $a" used in sort comparison at - line 1108.
1072 "my $a" used in sort comparison at - line 1203.
1073 "my $b" used in sort comparison at - line 1203.
1074 "my $a" used in sort comparison at - line 1204.
1075 "my $b" used in sort comparison at - line 1204.
1076 "my $a" used in sort comparison at - line 1205.
1077 "my $b" used in sort comparison at - line 1205.
1078 "my $b" used in sort comparison at - line 1206.
1079 "my $a" used in sort comparison at - line 1206.
1080 "my $b" used in sort comparison at - line 1207.
1081 "my $a" used in sort comparison at - line 1207.
1082 "my $b" used in sort comparison at - line 1208.
1083 "my $a" used in sort comparison at - line 1208.
1085 # op.c [S_simplify_sort]
1086 use warnings 'syntax'; use 5.01;
1088 sort { $a <=> $b } ();
1090 "state $a" used in sort comparison at - line 4.
1092 # op.c [Perl_ck_cmp]
1093 use warnings 'syntax' ;
1094 no warnings 'deprecated';
1131 $[ used in numeric lt (<) (did you mean $] ?) at - line 4.
1132 $[ used in numeric gt (>) (did you mean $] ?) at - line 5.
1133 $[ used in numeric le (<=) (did you mean $] ?) at - line 6.
1134 $[ used in numeric ge (>=) (did you mean $] ?) at - line 7.
1135 $[ used in numeric lt (<) (did you mean $] ?) at - line 8.
1136 $[ used in numeric gt (>) (did you mean $] ?) at - line 9.
1137 $[ used in numeric le (<=) (did you mean $] ?) at - line 10.
1138 $[ used in numeric ge (>=) (did you mean $] ?) at - line 11.
1139 $[ used in numeric lt (<) (did you mean $] ?) at - line 13.
1140 $[ used in numeric gt (>) (did you mean $] ?) at - line 14.
1141 $[ used in numeric le (<=) (did you mean $] ?) at - line 15.
1142 $[ used in numeric ge (>=) (did you mean $] ?) at - line 16.
1143 $[ used in numeric lt (<) (did you mean $] ?) at - line 17.
1144 $[ used in numeric gt (>) (did you mean $] ?) at - line 18.
1145 $[ used in numeric le (<=) (did you mean $] ?) at - line 19.
1146 $[ used in numeric ge (>=) (did you mean $] ?) at - line 20.
1148 # op.c [Perl_ck_length]
1149 use warnings 'syntax' ;
1158 length() used on @a (did you mean "scalar(@a)"?) at - line 3.
1159 length() used on %b (did you mean "scalar(keys %b)"?) at - line 4.
1160 length() used on @array (did you mean "scalar(@array)"?) at - line 5.
1161 length() used on %hash (did you mean "scalar(keys %hash)"?) at - line 6.
1162 length() used on %h (did you mean "scalar(keys %h)"?) at - line 8.
1163 length() used on @g (did you mean "scalar(@g)"?) at - line 9.
1166 use warnings 'syntax' ;
1167 join /---/, 'x', 'y', 'z';
1169 /---/ should probably be written as "---" at - line 3.
1173 use open qw( :utf8 :std );
1174 use warnings 'syntax' ;
1175 join /~~~/, 'x', 'y', 'z';
1177 /~~~/ should probably be written as "~~~" at - line 5.
1180 use warnings 'prototype' ;
1183 no warnings 'prototype' ;
1187 main::fred() called too early to check prototype at - line 3.
1189 # op.c [Perl_newATTRSUB]
1191 use warnings 'void' ;
1192 BEGIN { $| = 1; print "in begin\n"; }
1193 CHECK { print "in check\n"; }
1194 INIT { print "in init\n"; }
1195 END { print "in end\n"; }
1196 print "in mainline\n";
1200 delete $INC{"abc.pm"};
1209 Too late to run CHECK block at abc.pm line 3.
1210 Too late to run INIT block at abc.pm line 4.
1213 Too late to run CHECK block at abc.pm line 3.
1214 Too late to run INIT block at abc.pm line 4.
1220 # op.c [Perl_newATTRSUB]
1222 no warnings 'void' ;
1223 BEGIN { $| = 1; print "in begin\n"; }
1224 CHECK { print "in check\n"; }
1225 INIT { print "in init\n"; }
1226 END { print "in end\n"; }
1227 print "in mainline\n";
1242 use warnings 'syntax' ;
1245 no warnings 'syntax' ;
1249 Useless use of push with no values at - line 4.
1250 Useless use of unshift with no values at - line 5.
1253 # 20020401 mjd@plover.com at suggestion of jfriedl@yahoo.com
1254 use warnings 'regexp';
1255 split /blah/g, "blah";
1256 no warnings 'regexp';
1257 split /blah/g, "blah";
1259 Use of /g modifier is meaningless in split at - line 4.
1262 use warnings 'precedence';
1269 $a = $b <=> $c & $d;
1270 $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
1271 no warnings 'precedence';
1278 $a = $b <=> $c & $d;
1280 Possible precedence problem on bitwise & operator at - line 3.
1281 Possible precedence problem on bitwise ^ operator at - line 4.
1282 Possible precedence problem on bitwise | operator at - line 5.
1283 Possible precedence problem on bitwise & operator at - line 6.
1284 Possible precedence problem on bitwise ^ operator at - line 7.
1285 Possible precedence problem on bitwise | operator at - line 8.
1286 Possible precedence problem on bitwise & operator at - line 9.
1290 use warnings 'precedence';
1297 $a = $b <=> $c & $d;
1298 no warnings 'precedence';
1305 $a = $b <=> $c & $d;
1307 Possible precedence problem on bitwise & operator at - line 4.
1308 Possible precedence problem on bitwise ^ operator at - line 5.
1309 Possible precedence problem on bitwise | operator at - line 6.
1310 Possible precedence problem on bitwise & operator at - line 7.
1311 Possible precedence problem on bitwise ^ operator at - line 8.
1312 Possible precedence problem on bitwise | operator at - line 9.
1313 Possible precedence problem on bitwise & operator at - line 10.
1317 # ok => local() has desired effect;
1318 # ignore=> local() silently ignored
1320 use warnings 'syntax';
1322 local(undef); # OP_UNDEF ignore
1323 sub lval : lvalue {};
1324 local(lval()); # OP_ENTERSUB
1325 local($x **= 1); # OP_POW
1326 local($x *= 1); # OP_MULTIPLY
1327 local($x /= 1); # OP_DIVIDE
1328 local($x %= 1); # OP_MODULO
1329 local($x x= 1); # OP_REPEAT
1330 local($x += 1); # OP_ADD
1331 local($x -= 1); # OP_SUBTRACT
1332 local($x .= 1); # OP_CONCAT
1333 local($x <<= 1); # OP_LEFT_SHIFT
1334 local($x >>= 1); # OP_RIGHT_SHIFT
1335 local($x &= 1); # OP_BIT_AND
1336 local($x ^= 1); # OP_BIT_XOR
1337 local($x |= 1); # OP_BIT_OR
1340 local($x *= 1); # OP_I_MULTIPLY
1341 local($x /= 1); # OP_I_DIVIDE
1342 local($x %= 1); # OP_I_MODULO
1343 local($x += 1); # OP_I_ADD
1344 local($x -= 1); # OP_I_SUBTRACT
1346 local($x?$y:$z) = 1; # OP_COND_EXPR ok
1347 # these two are fatal run-time errors instead
1348 #local(@$a); # OP_RV2AV ok
1349 #local(%$a); # OP_RV2HV ok
1350 local(*a); # OP_RV2GV ok
1351 local(@a[1,2]); # OP_ASLICE ok
1352 local(@a{1,2}); # OP_HSLICE ok
1353 local(@a = (1,2)); # OP_AASSIGN
1354 local($$x); # OP_RV2SV ok
1355 local($#a); # OP_AV2ARYLEN
1356 local($x = 1); # OP_SASSIGN
1357 local($x &&= 1); # OP_ANDASSIGN
1358 local($x ||= 1); # OP_ORASSIGN
1359 local($x //= 1); # OP_DORASSIGN
1360 local($a[0]); # OP_AELEMFAST ok
1362 local(substr($x,0,1)); # OP_SUBSTR
1363 local(pos($x)); # OP_POS
1364 local(vec($x,0,1)); # OP_VEC
1365 local($a[$b]); # OP_AELEM ok
1366 local($a{$b}); # OP_HELEM ok
1368 no warnings 'syntax';
1370 Useless localization of subroutine entry at - line 10.
1371 Useless localization of exponentiation (**) at - line 11.
1372 Useless localization of multiplication (*) at - line 12.
1373 Useless localization of division (/) at - line 13.
1374 Useless localization of modulus (%) at - line 14.
1375 Useless localization of repeat (x) at - line 15.
1376 Useless localization of addition (+) at - line 16.
1377 Useless localization of subtraction (-) at - line 17.
1378 Useless localization of concatenation (.) or string at - line 18.
1379 Useless localization of left bitshift (<<) at - line 19.
1380 Useless localization of right bitshift (>>) at - line 20.
1381 Useless localization of bitwise and (&) at - line 21.
1382 Useless localization of bitwise xor (^) at - line 22.
1383 Useless localization of bitwise or (|) at - line 23.
1384 Useless localization of integer multiplication (*) at - line 26.
1385 Useless localization of integer division (/) at - line 27.
1386 Useless localization of integer modulus (%) at - line 28.
1387 Useless localization of integer addition (+) at - line 29.
1388 Useless localization of integer subtraction (-) at - line 30.
1389 Useless localization of list assignment at - line 39.
1390 Useless localization of array length at - line 41.
1391 Useless localization of scalar assignment at - line 42.
1392 Useless localization of logical and assignment (&&=) at - line 43.
1393 Useless localization of logical or assignment (||=) at - line 44.
1394 Useless localization of defined or assignment (//=) at - line 45.
1395 Useless localization of substr at - line 48.
1396 Useless localization of match position at - line 49.
1397 Useless localization of vec at - line 50.
1404 my ($x5,@x6, %x7) if 0;
1407 # these shouldn't warn
1411 if (my $w2) { $a=1 }
1412 if ($a && (my $w3 = 1)) {$a = 2}
1415 Deprecated use of my() in false conditional at - line 2.
1416 Deprecated use of my() in false conditional at - line 3.
1417 Deprecated use of my() in false conditional at - line 4.
1418 Deprecated use of my() in false conditional at - line 5.
1419 Deprecated use of my() in false conditional at - line 6.
1420 Deprecated use of my() in false conditional at - line 7.
1421 Deprecated use of my() in false conditional at - line 8.
1426 use warnings 'deprecated';
1429 no warnings 'deprecated';
1433 Use of assignment to $[ is deprecated at - line 2.
1434 Use of assignment to $[ is deprecated at - line 3.
1435 Use of assignment to $[ is deprecated at - line 5.
1436 Use of assignment to $[ is deprecated at - line 6.
1439 use warnings 'void';
1440 @x = split /y/, "z";
1441 $x = split /y/, "z";
1444 @x = split /y/, "z";
1445 $x = split /y/, "z";
1448 Useless use of split in void context at - line 5.
1451 use warnings 'redefine' ;
1453 use open qw( :utf8 :std );
1456 no warnings 'redefine' ;
1459 Subroutine frèd redefined at - line 6.
1462 use warnings 'redefine' ;
1464 use open qw( :utf8 :std );
1467 no warnings 'redefine' ;
1470 Constant subroutine frèd redefined at - line 6.
1474 use open qw( :utf8 :std );
1478 Constant subroutine frèd redefined at - line 5.
1482 use open qw( :utf8 :std );
1484 *frèd = sub () { 2 };
1486 Constant subroutine main::frèd redefined at - line 5.
1489 use warnings 'redefine' ;
1491 use open qw( :utf8 :std );
1494 no warnings 'redefine' ;
1497 Subroutine ᚠርƊ redefined at - line 6.
1500 use warnings 'redefine' ;
1502 use open qw( :utf8 :std );
1505 no warnings 'redefine' ;
1508 Constant subroutine ᚠርƊ redefined at - line 6.
1512 use open qw( :utf8 :std );
1516 Constant subroutine ᚠርƊ redefined at - line 5.
1520 use open qw( :utf8 :std );
1522 *ᚠርƊ = sub () { 2 };
1524 Constant subroutine main::ᚠርƊ redefined at - line 5.
1527 sub DynaLoader::dl_error {};
1529 # We're testing that the warnings report the same line number:
1530 eval <<'EOC' or die $@;
1532 DynaLoader::boot_DynaLoader("DynaLoader");
1535 eval <<'EOC' or die $@;
1537 DynaLoader::boot_DynaLoader("DynaLoader");
1543 \ASubroutine DynaLoader::dl_error redefined at \(eval 1\) line 2\.
1545 Subroutine DynaLoader::dl_error redefined at \(eval 2\) line 2\.