3 Found = in conditional, should be ==
6 Scalar value %.*s better written as $%.*s"
10 Useless use of time in void context
11 Useless use of a variable in void context
12 Useless use of a constant in void context
17 Useless use of sort in scalar context
20 Applying %s to %s will act on scalar(%s)
21 my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
36 Parentheses missing around "my" list at -e line 1.
39 Parentheses missing around "local" list at -e line 1.
42 Bareword found in conditional at -e line 1.
43 use warnings 'bareword'; my $x = print(ABC || 1);
45 Value of %s may be \"0\"; use \"defined\"
47 $x = 1 while $x = <FH> ;
49 Subroutine fred redefined at -e line 1.
50 sub fred{1;} sub fred{1;}
52 Constant subroutine %s redefined
53 sub fred() {1;} sub fred() {1;}
55 Format FRED redefined at /tmp/x line 5.
61 Statement unlikely to be reached
62 (Maybe you meant system() when you said exec()?
65 Can't use defined(@array) (Maybe you should just omit the defined()?)
67 defined (@a = (1,2,3)) ;
69 Can't use defined(%hash) (Maybe you should just omit the defined()?)
72 "my %s" used in sort comparison
74 $[ used in comparison (did you mean $] ?)
76 length() used on @array (did you mean "scalar(@array)"?)
77 length() used on %hash (did you mean "scalar(keys %hash)"?)
79 /---/ should probably be written as "---"
82 %s() called too early to check prototype [Perl_peep]
83 fred() ; sub fred ($$) {}
86 Package '%s' not found (did you use the incorrect case?)
88 Use of /g modifier is meaningless in split
90 The bitwise feature is experimental [Perl_ck_bitop]
92 Possible precedence problem on bitwise %c operator [Perl_ck_bitop]
96 Prototype mismatch: [cv_ckproto]
100 oops: oopsAV [oopsAV] TODO
101 oops: oopsHV [oopsHV] TODO
105 use warnings 'syntax' ;
109 no warnings 'syntax' ;
114 Found = in conditional, should be == at - line 3.
115 Found = in conditional, should be == at - line 4.
118 use warnings 'syntax' ;
119 use constant foo => 1;
121 no warnings 'syntax' ;
126 # NAME unless with assignment as condition
127 use warnings 'syntax';
133 Found = in conditional, should be == at - line 3.
134 Found = in conditional, should be == at - line 4.
137 # NAME while with assignment as condition
138 use warnings 'syntax';
144 Found = in conditional, should be == at - line 3.
145 Found = in conditional, should be == at - line 4.
148 # NAME until with assignment as condition
149 use warnings 'syntax';
155 Found = in conditional, should be == at - line 3.
156 Found = in conditional, should be == at - line 4.
159 use warnings 'syntax' ;
170 no warnings 'syntax' ;
174 Scalar value @a[3] better written as $a[3] at - line 3.
175 Scalar value @a{3} better written as $a{3} at - line 4.
176 Scalar value @a["]"] better written as $a["]"] at - line 5.
177 Scalar value @a{"]"} better written as $a{"]"} at - line 6.
178 Scalar value @a["}"] better written as $a["}"] at - line 7.
179 Scalar value @a{"}"} better written as $a{"}"} at - line 8.
180 Scalar value @a{...} better written as $a{...} at - line 9.
181 Scalar value @a{...} better written as $a{...} at - line 10.
182 Scalar value @a[...] better written as $a[...] at - line 11.
183 Scalar value @a[...] better written as $a[...] at - line 12.
187 use open qw( :utf8 :std );
188 use warnings 'syntax' ;
191 no warnings 'syntax' ;
195 Scalar value @à[3] better written as $à[3] at - line 5.
196 Scalar value @à{3} better written as $à{3} at - line 6.
200 use open qw( :utf8 :std );
201 use warnings 'syntax' ;
204 no warnings 'syntax' ;
208 Scalar value @ぁ[3] better written as $ぁ[3] at - line 5.
209 Scalar value @ぁ{3} better written as $ぁ{3} at - line 6.
212 # "Scalar value better written as" false positives
213 # [perl #28380] and [perl #114024]
214 use warnings 'syntax';
217 @h{qw"a b c"} = 1..3;
218 @h{qw'a b c'} = 1..3;
219 @h{qw$a b c$} = 1..3;
220 @h{qw-a b c-} = 1..3;
221 @h{qw#a b c#} = 1..3;
222 @h{ qw#a b c#} = 1..3;
223 @h{ qw#a b c#} = 1..3; # tab before qw
227 sub foo() { qw/abc def ghi/ }
228 @X{+foo} = ( 1 .. 3 );
229 $_ = "abc"; @X{split ""} = ( 1 .. 3 );
230 my @s = @f{"}", "a"};
231 my @s = @f{"]", "a"};
239 use constant phoo => 1..3;
254 @h[qw"a b c"] = 1..3;
255 @h[qw'a b c'] = 1..3;
256 @h[qw$a b c$] = 1..3;
257 @h[qw-a b c-] = 1..3;
258 @h[qw#a b c#] = 1..3;
259 @h[ qw#a b c#] = 1..3;
260 @h[ qw#a b c#] = 1..3; # tab before qw
264 sub foo() { qw/abc def ghi/ }
265 @X[+foo] = ( 1 .. 3 );
266 $_ = "abc"; @X[split ""] = ( 1 .. 3 );
267 my @s = @f["}", "a"];
268 my @s = @f["]", "a"];
276 use constant phoo => 1..3;
292 # "Scalar value better written as" should not trigger for syntax errors
293 use warnings 'syntax';
296 syntax error at - line 4, near "[]"
297 Execution of - aborted due to compilation errors.
304 Can't use a hash as a reference at - line 3.
311 Can't use a hash as a reference at - line 3.
318 Can't use an array as a reference at - line 3.
325 Can't use an array as a reference at - line 3.
329 $main::foo = {}; %$main::foo->{"bar"};
332 Can't use a hash as a reference at - line 3.
336 $foo = {}; %$foo->{"bar"};
339 Can't use a hash as a reference at - line 3.
343 $main::foo = []; @$main::foo->[34];
346 Can't use an array as a reference at - line 3.
350 $foo = []; @$foo->[34];
353 Can't use an array as a reference at - line 3.
356 use warnings 'void' ; no warnings 'experimental::smartmatch'; close STDIN ;
358 1 x 3 ; # OP_REPEAT (folded)
359 (1) x 3 ; # OP_REPEAT
361 wantarray ; # OP_WANTARRAY
371 defined $a ; # OP_DEFINED
374 length $a ; # OP_LENGTH
375 substr $a,1 ; # OP_SUBSTR
376 vec $a,1,2 ; # OP_VEC
377 index $a,1,2 ; # OP_INDEX
378 rindex $a,1,2 ; # OP_RINDEX
379 sprintf $a ; # OP_SPRINTF
383 #values %a ; # OP_VALUES
387 unpack "a", "a" ; # OP_UNPACK
388 pack $a,"" ; # OP_PACK
389 join "", @_ ; # OP_JOIN
390 (@a)[0,1] ; # OP_LSLICE
393 sort(1,2) ; # OP_SORT
394 reverse(1,2) ; # OP_REVERSE
399 fileno STDIN ; # OP_FILENO
401 tell STDIN ; # OP_TELL
402 readlink 1; # OP_READLINK
404 localtime ; # OP_LOCALTIME
406 eval { getgrnam 1 }; # OP_GGRNAM
407 eval { getgrgid 1 }; # OP_GGRGID
408 eval { getpwnam 1 }; # OP_GPWNAM
409 eval { getpwuid 1 }; # OP_GPWUID
410 prototype "foo"; # OP_PROTOTYPE
411 $a ~~ $b; # OP_SMARTMATCH
419 grep /42/, (1,2); # OP_GREP. Not warned about (yet). Grep git logs for void_unusual to see why...
421 Useless use of a constant ("111") in void context at - line 2.
422 Useless use of repeat (x) in void context at - line 3.
423 Useless use of wantarray in void context at - line 5.
424 Useless use of reference-type operator in void context at - line 12.
425 Useless use of reference constructor in void context at - line 13.
426 Useless use of single ref constructor in void context at - line 14.
427 Useless use of defined operator in void context at - line 15.
428 Useless use of hex in void context at - line 16.
429 Useless use of oct in void context at - line 17.
430 Useless use of length in void context at - line 18.
431 Useless use of substr in void context at - line 19.
432 Useless use of vec in void context at - line 20.
433 Useless use of index in void context at - line 21.
434 Useless use of rindex in void context at - line 22.
435 Useless use of sprintf in void context at - line 23.
436 Useless use of array element in void context at - line 24.
437 Useless use of array slice in void context at - line 26.
438 Useless use of hash element in void context at - line 29.
439 Useless use of hash slice in void context at - line 30.
440 Useless use of unpack in void context at - line 31.
441 Useless use of pack in void context at - line 32.
442 Useless use of join or string in void context at - line 33.
443 Useless use of list slice in void context at - line 34.
444 Useless use of sort in void context at - line 37.
445 Useless use of reverse in void context at - line 38.
446 Useless use of range (or flop) in void context at - line 41.
447 Useless use of caller in void context at - line 42.
448 Useless use of fileno in void context at - line 43.
449 Useless use of eof in void context at - line 44.
450 Useless use of tell in void context at - line 45.
451 Useless use of readlink in void context at - line 46.
452 Useless use of time in void context at - line 47.
453 Useless use of localtime in void context at - line 48.
454 Useless use of gmtime in void context at - line 49.
455 Useless use of getgrnam in void context at - line 50.
456 Useless use of getgrgid in void context at - line 51.
457 Useless use of getpwnam in void context at - line 52.
458 Useless use of getpwuid in void context at - line 53.
459 Useless use of subroutine prototype in void context at - line 54.
460 Useless use of smart match in void context at - line 55.
461 Useless use of numeric comparison (<=>) in void context at - line 56.
462 Useless use of a constant ("dsatrewq") in void context at - line 57.
463 Useless use of a constant ("diatrewq") in void context at - line 58.
464 Useless use of a constant ("igatrewq") in void context at - line 59.
465 Useless use of __SUB__ in void context at - line 61.
466 Useless use of anonymous array ([]) in void context at - line 62.
469 use warnings 'void' ; close STDIN ;
470 my $x = sort (2,1,3);
474 Useless use of sort in scalar context at - line 3.
477 no warnings 'void' ; close STDIN ;
480 wantarray ; # OP_WANTARRAY
490 defined $a ; # OP_DEFINED
493 length $a ; # OP_LENGTH
494 substr $a,1 ; # OP_SUBSTR
495 vec $a,1,2 ; # OP_VEC
496 index $a,1,2 ; # OP_INDEX
497 rindex $a,1,2 ; # OP_RINDEX
498 sprintf $a ; # OP_SPRINTF
502 #values %a ; # OP_VALUES
506 unpack "a", "a" ; # OP_UNPACK
507 pack $a,"" ; # OP_PACK
509 (@a)[0,1] ; # OP_LSLICE
512 sort(1,2) ; # OP_SORT
513 reverse(1,2) ; # OP_REVERSE
518 fileno STDIN ; # OP_FILENO
520 tell STDIN ; # OP_TELL
521 readlink 1; # OP_READLINK
523 localtime ; # OP_LOCALTIME
525 eval { getgrnam 1 }; # OP_GGRNAM
526 eval { getgrgid 1 }; # OP_GGRGID
527 eval { getpwnam 1 }; # OP_GPWNAM
528 eval { getpwuid 1 }; # OP_GPWUID
529 prototype "foo"; # OP_PROTOTYPE
533 use warnings 'void' ;
534 for (@{[0]}) { "$_" } # check warning isn't duplicated
536 for (@{[0]}) { "$_" } # check warning isn't duplicated
538 Useless use of string in void context at - line 3.
541 use warnings 'void' ;
544 if ( ! $Config{d_telldir}) {
547 # telldir not present
552 telldir 1 ; # OP_TELLDIR
554 telldir 1 ; # OP_TELLDIR
556 Useless use of telldir in void context at - line 13.
559 use warnings 'void' ;
562 if ( ! $Config{d_getppid}) {
565 # getppid not present
570 getppid ; # OP_GETPPID
572 getppid ; # OP_GETPPID
574 Useless use of getppid in void context at - line 13.
577 use warnings 'void' ;
580 if ( ! $Config{d_getpgrp}) {
583 # getpgrp not present
588 getpgrp ; # OP_GETPGRP
590 getpgrp ; # OP_GETPGRP
592 Useless use of getpgrp in void context at - line 13.
595 use warnings 'void' ;
598 if ( ! $Config{d_times}) {
610 Useless use of times in void context at - line 13.
613 use warnings 'void' ;
616 if ( ! $Config{d_getprior} or $^O eq 'os2') { # Locks before fixpak22
619 # getpriority not present
624 getpriority 1,2; # OP_GETPRIORITY
626 getpriority 1,2; # OP_GETPRIORITY
628 Useless use of getpriority in void context at - line 13.
631 use warnings 'void' ;
634 if ( ! $Config{d_getlogin}) {
637 # getlogin not present
642 getlogin ; # OP_GETLOGIN
644 getlogin ; # OP_GETLOGIN
646 Useless use of getlogin in void context at - line 13.
649 use warnings 'void' ;
651 if ( ! $Config{d_socket}) {
654 # getsockname not present
655 # getpeername not present
656 # gethostbyname not present
657 # gethostbyaddr not present
658 # gethostent not present
659 # getnetbyname not present
660 # getnetbyaddr not present
661 # getnetent not present
662 # getprotobyname not present
663 # getprotobynumber not present
664 # getprotoent not present
665 # getservbyname not present
666 # getservbyport not present
667 # getservent not present
671 getsockname STDIN ; # OP_GETSOCKNAME
672 getpeername STDIN ; # OP_GETPEERNAME
673 gethostbyname 1 ; # OP_GHBYNAME
674 gethostbyaddr 1,2; # OP_GHBYADDR
675 gethostent ; # OP_GHOSTENT
676 getnetbyname 1 ; # OP_GNBYNAME
677 getnetbyaddr 1,2 ; # OP_GNBYADDR
678 getnetent ; # OP_GNETENT
679 getprotobyname 1; # OP_GPBYNAME
680 getprotobynumber 1; # OP_GPBYNUMBER
681 getprotoent ; # OP_GPROTOENT
682 getservbyname 1,2; # OP_GSBYNAME
683 getservbyport 1,2; # OP_GSBYPORT
684 getservent ; # OP_GSERVENT
687 getsockname STDIN ; # OP_GETSOCKNAME
688 getpeername STDIN ; # OP_GETPEERNAME
689 gethostbyname 1 ; # OP_GHBYNAME
690 gethostbyaddr 1,2; # OP_GHBYADDR
691 gethostent ; # OP_GHOSTENT
692 getnetbyname 1 ; # OP_GNBYNAME
693 getnetbyaddr 1,2 ; # OP_GNBYADDR
694 getnetent ; # OP_GNETENT
695 getprotobyname 1; # OP_GPBYNAME
696 getprotobynumber 1; # OP_GPBYNUMBER
697 getprotoent ; # OP_GPROTOENT
698 getservbyname 1,2; # OP_GSBYNAME
699 getservbyport 1,2; # OP_GSBYPORT
700 getservent ; # OP_GSERVENT
702 # some functions may not be there, so we exit without running
706 Useless use of getsockname in void context at - line 24.
707 Useless use of getpeername in void context at - line 25.
708 Useless use of gethostbyname in void context at - line 26.
709 Useless use of gethostbyaddr in void context at - line 27.
710 Useless use of gethostent in void context at - line 28.
711 Useless use of getnetbyname in void context at - line 29.
712 Useless use of getnetbyaddr in void context at - line 30.
713 Useless use of getnetent in void context at - line 31.
714 Useless use of getprotobyname in void context at - line 32.
715 Useless use of getprotobynumber in void context at - line 33.
716 Useless use of getprotoent in void context at - line 34.
717 Useless use of getservbyname in void context at - line 35.
718 Useless use of getservbyport in void context at - line 36.
719 Useless use of getservent in void context at - line 37.
722 use warnings 'void' ;
733 Useless use of a variable in void context at - line 3.
734 Useless use of a variable in void context at - line 4.
735 Useless use of a variable in void context at - line 5.
736 Useless use of a variable in void context at - line 6.
739 use warnings 'void' ;
742 "x" . "y"; # optimized to OP_CONST
743 2 + 2; # optimized to OP_CONST
744 use constant U => undef;
747 5 || print "bad\n"; # test OPpCONST_SHORTCIRCUIT
748 print "boo\n" if U; # test OPpCONST_SHORTCIRCUIT
749 if($foo){}elsif(""){} # test OPpCONST_SHORTCIRCUIT
753 "x" . "y"; # optimized to OP_CONST
754 2 + 2; # optimized to OP_CONST
756 Useless use of a constant ("abc") in void context at - line 3.
757 Useless use of a constant (7) in void context at - line 4.
758 Useless use of a constant ("xy") in void context at - line 5.
759 Useless use of a constant (4) in void context at - line 6.
760 Useless use of a constant (undef) in void context at - line 8.
761 Useless use of a constant ("\"\t\n") in void context at - line 9.
765 if (ord('A') == 193) {
766 print "SKIPPED\n# Result varies depending on EBCDIC code page";
771 use open qw( :utf8 :std );
772 use warnings 'void' ;
775 Useless use of a constant ("\340\x{1e06}c") in void context at - line 11.
779 use open qw( :utf8 :std );
780 use warnings 'void' ;
781 "Ẋ" . "ƴ"; # optimized to OP_CONST
782 FOO; # Bareword optimized to OP_CONST
783 use constant ů => undef;
785 5 || print "bad\n"; # test OPpCONST_SHORTCIRCUIT
786 print "boo\n" if ů; # test OPpCONST_SHORTCIRCUIT
789 "Ẋ" . "ƴ"; # optimized to OP_CONST
791 Useless use of a constant ("\x{1e8a}\x{1b4}") in void context at - line 5.
792 Useless use of a constant ("\x{ff26}\x{ff2f}\x{ff2f}") in void context at - line 6.
793 Useless use of a constant (undef) in void context at - line 8.
797 use warnings 'misc' ; use utf8;
798 my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;my $d = 'test';
818 my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; my $d = 'test';
836 Applying pattern match (m//) to @a will act on scalar(@a) at - line 5.
837 Applying substitution (s///) to @a2 will act on scalar(@a2) at - line 6.
838 Applying transliteration (tr///) to @a3 will act on scalar(@a3) at - line 7.
839 Applying pattern match (m//) to @array will act on scalar(@array) at - line 8.
840 Applying substitution (s///) to @array will act on scalar(@array) at - line 9.
841 Applying transliteration (tr///) to @array will act on scalar(@array) at - line 10.
842 Applying pattern match (m//) to %a will act on scalar(%a) at - line 11.
843 Applying substitution (s///) to %a2 will act on scalar(%a2) at - line 12.
844 Applying transliteration (tr///) to %a3 will act on scalar(%a3) at - line 13.
845 Applying pattern match (m//) to %hash will act on scalar(%hash) at - line 14.
846 Applying substitution (s///) to %hash will act on scalar(%hash) at - line 15.
847 Applying transliteration (tr///) to %hash will act on scalar(%hash) at - line 16.
848 Useless use of /d modifier in transliteration operator at - line 17.
849 Replacement list is longer than search list at - line 18.
850 Useless use of /d modifier in transliteration operator at - line 20.
851 Replacement list is longer than search list at - line 21.
852 Can't modify array dereference in substitution (s///) at - line 6, near "s/a/b/ ;"
853 BEGIN not safe after errors--compilation aborted at - line 23.
856 use warnings 'parenthesis' ;
858 my @foo,%bar, $quux; # there's a TAB here
861 no warnings 'parenthesis' ;
864 Parentheses missing around "my" list at - line 3.
865 Parentheses missing around "my" list at - line 4.
868 use warnings 'parenthesis' ;
871 no warnings 'parenthesis' ;
874 Parentheses missing around "our" list at - line 3.
877 use warnings 'parenthesis' ;
878 local $a, $b = (1,2);
881 no warnings 'parenthesis' ;
882 local $c, $d = (1,2);
884 Parentheses missing around "local" list at - line 3.
885 Parentheses missing around "local" list at - line 4.
886 Parentheses missing around "local" list at - line 5.
889 use warnings 'bareword' ;
891 no warnings 'bareword' ;
894 Bareword found in conditional at - line 3.
900 use warnings 'misc' ;
902 $x = 1 if $x = <FH> ;
906 $x = 1 if $x = <FH> ;
910 Value of <HANDLE> construct can be "0"; test with defined() at - line 4.
911 Value of <HANDLE> construct can be "0"; test with defined() at - line 5.
914 use warnings 'misc' ;
916 $x = 1 if $x = readdir FH ;
920 $x = 1 if $x = readdir FH ;
925 Value of readdir() operator can be "0"; test with defined() at - line 4.
926 Value of readdir() operator can be "0"; test with defined() at - line 5.
929 use warnings 'misc' ;
938 Value of glob construct can be "0"; test with defined() at - line 3.
939 Value of glob construct can be "0"; test with defined() at - line 4.
942 use warnings 'misc' ;
944 $x = 1 if $x = each %a ;
946 $x = 1 if $x = each %a ;
948 Value of each() operator can be "0"; test with defined() at - line 4.
951 use warnings 'misc' ;
952 $x = 1 while $x = <*> and 0 ;
954 $x = 1 while $x = <*> and 0 ;
956 Value of glob construct can be "0"; test with defined() at - line 3.
959 use warnings 'misc' ;
961 $x = 1 while $x = readdir FH and 0 ;
963 $x = 1 while $x = readdir FH and 0 ;
966 Value of readdir() operator can be "0"; test with defined() at - line 4.
971 ($_ = <FH>) // ($_ = 1);
977 use warnings 'redefine' ;
980 sub fred { # warning should be for this line
982 no warnings 'redefine' ;
987 Subroutine fred redefined at - line 4.
988 Subroutine fred redefined at - line 5.
991 use warnings 'redefine' ;
994 no warnings 'redefine' ;
997 Constant subroutine fred redefined at - line 4.
1003 Constant subroutine fred redefined at - line 3.
1007 *fred = sub () { 2 };
1009 Constant subroutine main::fred redefined at - line 3.
1012 use feature "lexical_subs", "state";
1013 my sub fred () { 1 }
1016 sub george () { 2 } # should *not* produce redef warnings by default
1017 state sub phred () { 1 }
1019 state sub jorge { 1 }
1020 sub jorge () { 2 } # should *not* produce redef warnings by default
1022 Prototype mismatch: sub fred () vs none at - line 4.
1023 Constant subroutine fred redefined at - line 4.
1024 Prototype mismatch: sub george: none vs () at - line 6.
1025 Prototype mismatch: sub phred () vs none at - line 8.
1026 Constant subroutine phred redefined at - line 8.
1027 Prototype mismatch: sub jorge: none vs () at - line 10.
1030 no warnings 'redefine' ;
1036 no warnings 'redefine' ;
1038 *fred = sub () { 2 };
1042 use warnings 'redefine' ;
1047 no warnings 'redefine' ;
1051 Format FRED redefined at - line 5.
1054 use warnings 'exec' ;
1058 Statement unlikely to be reached at - line 4.
1059 (Maybe you meant system() when you said exec()?)
1061 # op.c, no warning if exec isn't a statement.
1062 use warnings 'exec' ;
1063 $a || exec "$^X -e 1" ;
1071 Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at - line 2.
1077 Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at - line 2.
1080 defined(@a = (1,2,3));
1087 Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at - line 2.
1093 Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at - line 2.
1096 no warnings 'exec' ;
1105 use constant foo=>bar; sub foo(@);
1106 use constant bav=>bar; sub bav(); # no warning
1109 Prototype mismatch: sub main::fred () vs ($) at - line 3.
1110 Prototype mismatch: sub foo () vs (@) at - line 4.
1111 Prototype mismatch: sub btu: none vs () at - line 6.
1115 use open qw( :utf8 :std );
1119 Prototype mismatch: sub main::frèd () vs ($) at - line 5.
1123 use open qw( :utf8 :std );
1125 eval "sub fòò (@\$\0) {}";
1127 Prototype after '@' for main::fòò : @$\0 at (eval 1) line 1.
1128 Illegal character in prototype for main::fòò : @$\0 at (eval 1) line 1.
1132 use open qw( :utf8 :std );
1134 eval "sub foo (@\0) {}";
1136 Prototype after '@' for main::foo : @\0 at (eval 1) line 1.
1137 Illegal character in prototype for main::foo : @\0 at (eval 1) line 1.
1141 if (ord('A') == 193) {
1142 print "SKIPPED\n# Different results on EBCDIC";
1147 use open qw( :utf8 :std );
1149 BEGIN { $::{"foo"} = "\@\$\0L\351on" }
1150 BEGIN { eval "sub foo (@\$\0L\x{c3}\x{a9}on) {}"; }
1152 Prototype after '@' for main::foo : @$\x{0}L... at (eval 1) line 1.
1153 Illegal character in prototype for main::foo : @$\x{0}L... at (eval 1) line 1.
1157 use open qw( :utf8 :std );
1159 BEGIN { eval "sub foo (@\0) {}"; }
1161 Prototype after '@' for main::foo : @\0 at (eval 1) line 1.
1162 Illegal character in prototype for main::foo : @\0 at (eval 1) line 1.
1166 eval "sub foo (@\xAB) {}";
1168 Prototype after '@' for main::foo : @\x{ab} at (eval 1) line 1.
1169 Illegal character in prototype for main::foo : @\x{ab} at (eval 1) line 1.
1173 use open qw( :utf8 :std );
1175 BEGIN { eval "sub foo (@\x{30cb}) {}"; }
1177 Prototype after '@' for main::foo : @\x{30cb} at (eval 1) line 1.
1178 Illegal character in prototype for main::foo : @\x{30cb} at (eval 1) line 1.
1182 use open qw( :utf8 :std );
1184 BEGIN { $::{"foo"} = "\x{30cb}" }
1185 BEGIN { eval "sub foo {}"; }
1187 Prototype mismatch: sub main::foo (ニ) vs none at (eval 1) line 1.
1194 no warnings 'prototype' ;
1197 use warnings 'prototype' ;
1204 Prototype mismatch: sub main::fred () vs ($) at - line 4.
1205 Prototype mismatch: sub main::freD () vs ($) at - line 11.
1206 Prototype mismatch: sub main::FRED () vs ($) at - line 14.
1208 # op.c [S_simplify_sort]
1210 my @tests = split /^/, '
1211 sort {$a <=> $b} @a;
1212 sort {$a cmp $b} @a;
1213 { use integer; sort {$a <=> $b} @a}
1214 sort {$b <=> $a} @a;
1215 sort {$b cmp $a} @a;
1216 { use integer; sort {$b <=> $a} @a}
1218 for my $pragma ('use warnings "syntax";', '') {
1219 for my $vars ('', 'my $a;', 'my $b;', 'my ($a,$b);') {
1220 for my $inner_stmt ('', 'print;', 'func();') {
1221 eval "#line " . ++$line . "01 -\n$pragma\n$vars"
1222 . join "", map s/sort \{\K/$inner_stmt/r, @tests;
1228 use warnings 'syntax';
1230 # These used to be errors!
1231 sort { ; } $a <=> $b;
1232 sort { ; } $a, "<=>";
1233 sort { ; } $a, $cmp;
1234 sort $a, $b if $cmpany_name;
1238 "my $a" used in sort comparison at - line 403.
1239 "my $a" used in sort comparison at - line 404.
1240 "my $a" used in sort comparison at - line 405.
1241 "my $a" used in sort comparison at - line 406.
1242 "my $a" used in sort comparison at - line 407.
1243 "my $a" used in sort comparison at - line 408.
1244 "my $a" used in sort comparison at - line 503.
1245 "my $a" used in sort comparison at - line 504.
1246 "my $a" used in sort comparison at - line 505.
1247 "my $a" used in sort comparison at - line 506.
1248 "my $a" used in sort comparison at - line 507.
1249 "my $a" used in sort comparison at - line 508.
1250 "my $a" used in sort comparison at - line 603.
1251 "my $a" used in sort comparison at - line 604.
1252 "my $a" used in sort comparison at - line 605.
1253 "my $a" used in sort comparison at - line 606.
1254 "my $a" used in sort comparison at - line 607.
1255 "my $a" used in sort comparison at - line 608.
1256 "my $b" used in sort comparison at - line 703.
1257 "my $b" used in sort comparison at - line 704.
1258 "my $b" used in sort comparison at - line 705.
1259 "my $b" used in sort comparison at - line 706.
1260 "my $b" used in sort comparison at - line 707.
1261 "my $b" used in sort comparison at - line 708.
1262 "my $b" used in sort comparison at - line 803.
1263 "my $b" used in sort comparison at - line 804.
1264 "my $b" used in sort comparison at - line 805.
1265 "my $b" used in sort comparison at - line 806.
1266 "my $b" used in sort comparison at - line 807.
1267 "my $b" used in sort comparison at - line 808.
1268 "my $b" used in sort comparison at - line 903.
1269 "my $b" used in sort comparison at - line 904.
1270 "my $b" used in sort comparison at - line 905.
1271 "my $b" used in sort comparison at - line 906.
1272 "my $b" used in sort comparison at - line 907.
1273 "my $b" used in sort comparison at - line 908.
1274 "my $a" used in sort comparison at - line 1003.
1275 "my $b" used in sort comparison at - line 1003.
1276 "my $a" used in sort comparison at - line 1004.
1277 "my $b" used in sort comparison at - line 1004.
1278 "my $a" used in sort comparison at - line 1005.
1279 "my $b" used in sort comparison at - line 1005.
1280 "my $b" used in sort comparison at - line 1006.
1281 "my $a" used in sort comparison at - line 1006.
1282 "my $b" used in sort comparison at - line 1007.
1283 "my $a" used in sort comparison at - line 1007.
1284 "my $b" used in sort comparison at - line 1008.
1285 "my $a" used in sort comparison at - line 1008.
1286 "my $a" used in sort comparison at - line 1103.
1287 "my $b" used in sort comparison at - line 1103.
1288 "my $a" used in sort comparison at - line 1104.
1289 "my $b" used in sort comparison at - line 1104.
1290 "my $a" used in sort comparison at - line 1105.
1291 "my $b" used in sort comparison at - line 1105.
1292 "my $b" used in sort comparison at - line 1106.
1293 "my $a" used in sort comparison at - line 1106.
1294 "my $b" used in sort comparison at - line 1107.
1295 "my $a" used in sort comparison at - line 1107.
1296 "my $b" used in sort comparison at - line 1108.
1297 "my $a" used in sort comparison at - line 1108.
1298 "my $a" used in sort comparison at - line 1203.
1299 "my $b" used in sort comparison at - line 1203.
1300 "my $a" used in sort comparison at - line 1204.
1301 "my $b" used in sort comparison at - line 1204.
1302 "my $a" used in sort comparison at - line 1205.
1303 "my $b" used in sort comparison at - line 1205.
1304 "my $b" used in sort comparison at - line 1206.
1305 "my $a" used in sort comparison at - line 1206.
1306 "my $b" used in sort comparison at - line 1207.
1307 "my $a" used in sort comparison at - line 1207.
1308 "my $b" used in sort comparison at - line 1208.
1309 "my $a" used in sort comparison at - line 1208.
1311 # op.c [S_simplify_sort]
1312 use warnings 'syntax'; use 5.01;
1314 sort { $a <=> $b } ();
1316 "state $a" used in sort comparison at - line 4.
1318 # op.c [Perl_ck_cmp]
1319 use warnings 'syntax' ;
1320 no warnings 'deprecated';
1357 $[ used in numeric lt (<) (did you mean $] ?) at - line 4.
1358 $[ used in numeric gt (>) (did you mean $] ?) at - line 5.
1359 $[ used in numeric le (<=) (did you mean $] ?) at - line 6.
1360 $[ used in numeric ge (>=) (did you mean $] ?) at - line 7.
1361 $[ used in numeric lt (<) (did you mean $] ?) at - line 8.
1362 $[ used in numeric gt (>) (did you mean $] ?) at - line 9.
1363 $[ used in numeric le (<=) (did you mean $] ?) at - line 10.
1364 $[ used in numeric ge (>=) (did you mean $] ?) at - line 11.
1365 $[ used in numeric lt (<) (did you mean $] ?) at - line 13.
1366 $[ used in numeric gt (>) (did you mean $] ?) at - line 14.
1367 $[ used in numeric le (<=) (did you mean $] ?) at - line 15.
1368 $[ used in numeric ge (>=) (did you mean $] ?) at - line 16.
1369 $[ used in numeric lt (<) (did you mean $] ?) at - line 17.
1370 $[ used in numeric gt (>) (did you mean $] ?) at - line 18.
1371 $[ used in numeric le (<=) (did you mean $] ?) at - line 19.
1372 $[ used in numeric ge (>=) (did you mean $] ?) at - line 20.
1374 # op.c [Perl_ck_length]
1375 use warnings 'syntax' ;
1384 length() used on @a (did you mean "scalar(@a)"?) at - line 3.
1385 length() used on %b (did you mean "scalar(keys %b)"?) at - line 4.
1386 length() used on @array (did you mean "scalar(@array)"?) at - line 5.
1387 length() used on %hash (did you mean "scalar(keys %hash)"?) at - line 6.
1388 length() used on %h (did you mean "scalar(keys %h)"?) at - line 8.
1389 length() used on @g (did you mean "scalar(@g)"?) at - line 9.
1392 use warnings 'syntax' ;
1393 join /---/, 'x', 'y', 'z';
1395 /---/ should probably be written as "---" at - line 3.
1399 use open qw( :utf8 :std );
1400 use warnings 'syntax' ;
1401 join /~~~/, 'x', 'y', 'z';
1403 /~~~/ should probably be written as "~~~" at - line 5.
1406 use warnings 'prototype' ;
1409 no warnings 'prototype' ;
1413 main::fred() called too early to check prototype at - line 3.
1415 # op.c [Perl_newATTRSUB]
1417 use warnings 'void' ;
1418 BEGIN { $| = 1; print "in begin\n"; }
1419 CHECK { print "in check\n"; }
1420 INIT { print "in init\n"; }
1421 END { print "in end\n"; }
1422 print "in mainline\n";
1426 delete $INC{"abc.pm"};
1435 Too late to run CHECK block at abc.pm line 3.
1436 Too late to run INIT block at abc.pm line 4.
1439 Too late to run CHECK block at abc.pm line 3.
1440 Too late to run INIT block at abc.pm line 4.
1446 # op.c [Perl_newATTRSUB]
1448 no warnings 'void' ;
1449 BEGIN { $| = 1; print "in begin\n"; }
1450 CHECK { print "in check\n"; }
1451 INIT { print "in init\n"; }
1452 END { print "in end\n"; }
1453 print "in mainline\n";
1468 use warnings 'syntax' ;
1471 no warnings 'syntax' ;
1475 Useless use of push with no values at - line 4.
1476 Useless use of unshift with no values at - line 5.
1479 # 20020401 mjd@plover.com at suggestion of jfriedl@yahoo.com
1480 use warnings 'regexp';
1481 split /blah/g, "blah";
1482 no warnings 'regexp';
1483 split /blah/g, "blah";
1485 Use of /g modifier is meaningless in split at - line 4.
1487 use feature "bitwise";
1502 use warnings "experimental::bitwise";
1517 no warnings "experimental::bitwise";
1533 The bitwise feature is experimental at - line 2.
1534 The bitwise feature is experimental at - line 3.
1535 The bitwise feature is experimental at - line 4.
1536 The bitwise feature is experimental at - line 5.
1537 The bitwise feature is experimental at - line 6.
1538 The bitwise feature is experimental at - line 7.
1539 The bitwise feature is experimental at - line 8.
1540 The bitwise feature is experimental at - line 9.
1541 The bitwise feature is experimental at - line 10.
1542 The bitwise feature is experimental at - line 11.
1543 The bitwise feature is experimental at - line 12.
1544 The bitwise feature is experimental at - line 13.
1545 The bitwise feature is experimental at - line 14.
1546 The bitwise feature is experimental at - line 15.
1547 The bitwise feature is experimental at - line 17.
1548 The bitwise feature is experimental at - line 18.
1549 The bitwise feature is experimental at - line 19.
1550 The bitwise feature is experimental at - line 20.
1551 The bitwise feature is experimental at - line 21.
1552 The bitwise feature is experimental at - line 22.
1553 The bitwise feature is experimental at - line 23.
1554 The bitwise feature is experimental at - line 24.
1555 The bitwise feature is experimental at - line 25.
1556 The bitwise feature is experimental at - line 26.
1557 The bitwise feature is experimental at - line 27.
1558 The bitwise feature is experimental at - line 28.
1559 The bitwise feature is experimental at - line 29.
1560 The bitwise feature is experimental at - line 30.
1563 use warnings 'precedence';
1570 $a = $b <=> $c & $d;
1571 $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
1573 use experimental 'bitwise';
1580 $a = $b <=> $c & $d;
1581 $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
1582 $a = $b &. $c == $d;
1583 $a = $b ^. $c != $d;
1586 $a = $b >= $c ^. $d;
1587 $a = $b <= $c |. $d;
1588 $a = $b <=> $c &. $d;
1589 $a &.= $b == $c; $a |.= $b == $c; $a ^.= $b == $c; # shouldn't warn
1591 no warnings 'precedence';
1598 $a = $b <=> $c & $d;
1600 use experimental 'bitwise';
1607 $a = $b <=> $c & $d;
1608 $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
1609 $a = $b &. $c == $d;
1610 $a = $b ^. $c != $d;
1613 $a = $b >= $c ^. $d;
1614 $a = $b <= $c |. $d;
1615 $a = $b <=> $c &. $d;
1616 $a &.= $b == $c; $a |.= $b == $c; $a ^.= $b == $c; # shouldn't warn
1619 Possible precedence problem on bitwise & operator at - line 3.
1620 Possible precedence problem on bitwise ^ operator at - line 4.
1621 Possible precedence problem on bitwise | operator at - line 5.
1622 Possible precedence problem on bitwise & operator at - line 6.
1623 Possible precedence problem on bitwise ^ operator at - line 7.
1624 Possible precedence problem on bitwise | operator at - line 8.
1625 Possible precedence problem on bitwise & operator at - line 9.
1626 Possible precedence problem on bitwise & operator at - line 13.
1627 Possible precedence problem on bitwise ^ operator at - line 14.
1628 Possible precedence problem on bitwise | operator at - line 15.
1629 Possible precedence problem on bitwise & operator at - line 16.
1630 Possible precedence problem on bitwise ^ operator at - line 17.
1631 Possible precedence problem on bitwise | operator at - line 18.
1632 Possible precedence problem on bitwise & operator at - line 19.
1633 Possible precedence problem on bitwise &. operator at - line 21.
1634 Possible precedence problem on bitwise ^. operator at - line 22.
1635 Possible precedence problem on bitwise |. operator at - line 23.
1636 Possible precedence problem on bitwise &. operator at - line 24.
1637 Possible precedence problem on bitwise ^. operator at - line 25.
1638 Possible precedence problem on bitwise |. operator at - line 26.
1639 Possible precedence problem on bitwise &. operator at - line 27.
1643 use warnings 'precedence';
1650 $a = $b <=> $c & $d;
1651 no warnings 'precedence';
1658 $a = $b <=> $c & $d;
1660 Possible precedence problem on bitwise & operator at - line 4.
1661 Possible precedence problem on bitwise ^ operator at - line 5.
1662 Possible precedence problem on bitwise | operator at - line 6.
1663 Possible precedence problem on bitwise & operator at - line 7.
1664 Possible precedence problem on bitwise ^ operator at - line 8.
1665 Possible precedence problem on bitwise | operator at - line 9.
1666 Possible precedence problem on bitwise & operator at - line 10.
1670 # ok => local() has desired effect;
1671 # ignore=> local() silently ignored
1673 use warnings 'syntax';
1675 local(undef); # OP_UNDEF ignore
1676 sub lval : lvalue {};
1677 local(lval()); # OP_ENTERSUB
1678 local($x **= 1); # OP_POW
1679 local($x *= 1); # OP_MULTIPLY
1680 local($x /= 1); # OP_DIVIDE
1681 local($x %= 1); # OP_MODULO
1682 local($x x= 1); # OP_REPEAT
1683 local($x += 1); # OP_ADD
1684 local($x -= 1); # OP_SUBTRACT
1685 local($x .= 1); # OP_CONCAT
1686 local($x <<= 1); # OP_LEFT_SHIFT
1687 local($x >>= 1); # OP_RIGHT_SHIFT
1688 local($x &= 1); # OP_BIT_AND
1689 local($x ^= 1); # OP_BIT_XOR
1690 local($x |= 1); # OP_BIT_OR
1693 local($x *= 1); # OP_I_MULTIPLY
1694 local($x /= 1); # OP_I_DIVIDE
1695 local($x %= 1); # OP_I_MODULO
1696 local($x += 1); # OP_I_ADD
1697 local($x -= 1); # OP_I_SUBTRACT
1699 local($x?$y:$z) = 1; # OP_COND_EXPR ok
1700 # these two are fatal run-time errors instead
1701 #local(@$a); # OP_RV2AV ok
1702 #local(%$a); # OP_RV2HV ok
1703 local(*a); # OP_RV2GV ok
1704 local(@a[1,2]); # OP_ASLICE ok
1705 local(@a{1,2}); # OP_HSLICE ok
1706 local(@a = (1,2)); # OP_AASSIGN
1707 local($$x); # OP_RV2SV ok
1708 local($#a); # OP_AV2ARYLEN
1709 local($x = 1); # OP_SASSIGN
1710 local($x &&= 1); # OP_ANDASSIGN
1711 local($x ||= 1); # OP_ORASSIGN
1712 local($x //= 1); # OP_DORASSIGN
1713 local($a[0]); # OP_AELEMFAST ok
1715 local(substr($x,0,1)); # OP_SUBSTR
1716 local(pos($x)); # OP_POS
1717 local(vec($x,0,1)); # OP_VEC
1718 local($a[$b]); # OP_AELEM ok
1719 local($a{$b}); # OP_HELEM ok
1721 no warnings 'syntax';
1723 Useless localization of subroutine entry at - line 10.
1724 Useless localization of exponentiation (**) at - line 11.
1725 Useless localization of multiplication (*) at - line 12.
1726 Useless localization of division (/) at - line 13.
1727 Useless localization of modulus (%) at - line 14.
1728 Useless localization of repeat (x) at - line 15.
1729 Useless localization of addition (+) at - line 16.
1730 Useless localization of subtraction (-) at - line 17.
1731 Useless localization of concatenation (.) or string at - line 18.
1732 Useless localization of left bitshift (<<) at - line 19.
1733 Useless localization of right bitshift (>>) at - line 20.
1734 Useless localization of bitwise and (&) at - line 21.
1735 Useless localization of bitwise xor (^) at - line 22.
1736 Useless localization of bitwise or (|) at - line 23.
1737 Useless localization of integer multiplication (*) at - line 26.
1738 Useless localization of integer division (/) at - line 27.
1739 Useless localization of integer modulus (%) at - line 28.
1740 Useless localization of integer addition (+) at - line 29.
1741 Useless localization of integer subtraction (-) at - line 30.
1742 Useless localization of list assignment at - line 39.
1743 Useless localization of array length at - line 41.
1744 Useless localization of scalar assignment at - line 42.
1745 Useless localization of logical and assignment (&&=) at - line 43.
1746 Useless localization of logical or assignment (||=) at - line 44.
1747 Useless localization of defined or assignment (//=) at - line 45.
1748 Useless localization of substr at - line 48.
1749 Useless localization of match position at - line 49.
1750 Useless localization of vec at - line 50.
1757 my ($x5,@x6, %x7) if 0;
1760 # these shouldn't warn
1764 if (my $w2) { $a=1 }
1765 if ($a && (my $w3 = 1)) {$a = 2}
1768 Deprecated use of my() in false conditional at - line 2.
1769 Deprecated use of my() in false conditional at - line 3.
1770 Deprecated use of my() in false conditional at - line 4.
1771 Deprecated use of my() in false conditional at - line 5.
1772 Deprecated use of my() in false conditional at - line 6.
1773 Deprecated use of my() in false conditional at - line 7.
1774 Deprecated use of my() in false conditional at - line 8.
1779 use warnings 'deprecated';
1782 no warnings 'deprecated';
1786 Use of assignment to $[ is deprecated at - line 2.
1787 Use of assignment to $[ is deprecated at - line 3.
1788 Use of assignment to $[ is deprecated at - line 5.
1789 Use of assignment to $[ is deprecated at - line 6.
1792 use warnings 'void';
1793 @x = split /y/, "z";
1794 $x = split /y/, "z";
1797 @x = split /y/, "z";
1798 $x = split /y/, "z";
1801 Useless use of split in void context at - line 5.
1804 use warnings 'redefine' ;
1806 use open qw( :utf8 :std );
1809 no warnings 'redefine' ;
1812 Subroutine frèd redefined at - line 6.
1815 use warnings 'redefine' ;
1817 use open qw( :utf8 :std );
1820 no warnings 'redefine' ;
1823 Constant subroutine frèd redefined at - line 6.
1827 use open qw( :utf8 :std );
1831 Constant subroutine frèd redefined at - line 5.
1835 use open qw( :utf8 :std );
1837 *frèd = sub () { 2 };
1839 Constant subroutine main::frèd redefined at - line 5.
1842 use warnings 'redefine' ;
1844 use open qw( :utf8 :std );
1847 no warnings 'redefine' ;
1850 Subroutine ᚠርƊ redefined at - line 6.
1853 use warnings 'redefine' ;
1855 use open qw( :utf8 :std );
1858 no warnings 'redefine' ;
1861 Constant subroutine ᚠርƊ redefined at - line 6.
1865 use open qw( :utf8 :std );
1869 Constant subroutine ᚠርƊ redefined at - line 5.
1873 use open qw( :utf8 :std );
1875 *ᚠርƊ = sub () { 2 };
1877 Constant subroutine main::ᚠርƊ redefined at - line 5.
1880 sub DynaLoader::dl_error {};
1882 # We're testing that the warnings report the same line number:
1883 eval <<'EOC' or die $@;
1885 DynaLoader::boot_DynaLoader("DynaLoader");
1888 eval <<'EOC' or die $@;
1890 DynaLoader::boot_DynaLoader("DynaLoader");
1896 \ASubroutine DynaLoader::dl_error redefined at \(eval 1\) line 2\.
1898 Subroutine DynaLoader::dl_error redefined at \(eval 2\) line 2\.
1902 sub do_warn_1 { return $a or $b; }
1903 sub do_warn_2 { return $a and $b; }
1904 sub do_warn_3 { return $a xor $b; }
1905 sub do_warn_4 { die $a or $b; }
1906 sub do_warn_5 { die $a and $b; }
1907 sub do_warn_6 { die $a xor $b; }
1908 sub do_warn_7 { exit $a or $b; }
1909 sub do_warn_8 { exit $a and $b; }
1910 sub do_warn_9 { exit $a xor $b; }
1912 # Since exit is an unary operator, it is even stronger than
1914 sub do_warn_10 { exit $a || $b; }
1915 sub do_warn_11 { exit $a && $b; }
1917 sub do_warn_12 { goto $a or $b; }
1918 sub do_warn_13 { goto $a and $b; }
1919 sub do_warn_14 { goto $a xor $b; }
1920 sub do_warn_15 { next $a or $b while(1); }
1921 sub do_warn_16 { next $a and $b while(1); }
1922 sub do_warn_17 { next $a xor $b while(1); }
1923 sub do_warn_18 { last $a or $b while(1); }
1924 sub do_warn_19 { last $a and $b while(1); }
1925 sub do_warn_20 { last $a xor $b while(1); }
1926 sub do_warn_21 { redo $a or $b while(1); }
1927 sub do_warn_22 { redo $a and $b while(1); }
1928 sub do_warn_23 { redo $a xor $b while(1); }
1929 # These get re-written to "(return/die $a) and $b"
1930 sub do_warn_24 { $b if return $a; }
1931 sub do_warn_25 { $b if die $a; }
1933 Possible precedence issue with control flow operator at - line 3.
1934 Possible precedence issue with control flow operator at - line 4.
1935 Possible precedence issue with control flow operator at - line 5.
1936 Possible precedence issue with control flow operator at - line 6.
1937 Possible precedence issue with control flow operator at - line 7.
1938 Possible precedence issue with control flow operator at - line 8.
1939 Possible precedence issue with control flow operator at - line 9.
1940 Possible precedence issue with control flow operator at - line 10.
1941 Possible precedence issue with control flow operator at - line 11.
1942 Possible precedence issue with control flow operator at - line 15.
1943 Possible precedence issue with control flow operator at - line 16.
1944 Possible precedence issue with control flow operator at - line 18.
1945 Possible precedence issue with control flow operator at - line 19.
1946 Possible precedence issue with control flow operator at - line 20.
1947 Possible precedence issue with control flow operator at - line 21.
1948 Possible precedence issue with control flow operator at - line 22.
1949 Possible precedence issue with control flow operator at - line 23.
1950 Possible precedence issue with control flow operator at - line 24.
1951 Possible precedence issue with control flow operator at - line 25.
1952 Possible precedence issue with control flow operator at - line 26.
1953 Possible precedence issue with control flow operator at - line 27.
1954 Possible precedence issue with control flow operator at - line 28.
1955 Possible precedence issue with control flow operator at - line 29.
1956 Possible precedence issue with control flow operator at - line 31.
1957 Possible precedence issue with control flow operator at - line 32.
1960 # (same as above, except these should not warn)
1961 use constant FEATURE => 1;
1962 use constant MISSING_FEATURE => 0;
1964 sub dont_warn_1 { MISSING_FEATURE and return or dont_warn_3(); }
1965 sub dont_warn_2 { FEATURE || return and dont_warn_3(); }
1966 sub dont_warn_3 { not FEATURE and return or dont_warn_3(); }
1967 sub dont_warn_4 { !MISSING_FEATURE || return and dont_warn_3(); }
1968 sub dont_warn_5 { MISSING_FEATURE and die or dont_warn_3(); }
1969 sub dont_warn_6 { FEATURE || die and dont_warn_3(); }
1970 sub dont_warn_7 { not FEATURE and die or dont_warn_3(); }
1971 sub dont_warn_8 { !MISSING_FEATURE || die and dont_warn_3(); }
1972 sub dont_warn_9 { MISSING_FEATURE and goto $a or dont_warn_3(); }
1973 sub dont_warn_10 { FEATURE || goto $a and dont_warn_3(); }
1974 sub dont_warn_11 { not FEATURE and goto $a or dont_warn_3(); }
1975 sub dont_warn_12 { !MISSING_FEATURE || goto $a and dont_warn_3(); }
1977 sub dont_warn_13 { MISSING_FEATURE and exit $a or dont_warn_3(); }
1978 sub dont_warn_14 { FEATURE || exit $a and dont_warn_3(); }
1979 sub dont_warn_15 { not FEATURE and exit $a or dont_warn_3(); }
1980 sub dont_warn_16 { !MISSING_FEATURE || exit $a and dont_warn_3(); }
1982 sub dont_warn_17 { MISSING_FEATURE and next or dont_warn_3() while(1); }
1983 sub dont_warn_18 { FEATURE || next and dont_warn_3() while(1); }
1984 sub dont_warn_19 { not FEATURE and next or dont_warn_3() while(1); }
1985 sub dont_warn_20 { !MISSING_FEATURE || next and dont_warn_3() while(1); }
1986 sub dont_warn_21 { MISSING_FEATURE and redo or dont_warn_3() while(1); }
1987 sub dont_warn_22 { FEATURE || redo and dont_warn_3() while(1); }
1988 sub dont_warn_23 { not FEATURE and redo or dont_warn_3() while(1); }
1989 sub dont_warn_24 { !MISSING_FEATURE || redo and dont_warn_3() while(1); }
1990 sub dont_warn_25 { MISSING_FEATURE and last or dont_warn_3() while(1); }
1991 sub dont_warn_26 { FEATURE || last and dont_warn_3() while(1); }
1992 sub dont_warn_27 { not FEATURE and last or dont_warn_3() while(1); }
1993 sub dont_warn_28 { !MISSING_FEATURE || last and dont_warn_3() while(1); }
1995 # These are weird, but at least not ambiguous.
1996 sub dont_warn_29 { return ($a or $b); }
1997 sub dont_warn_30 { return ($a and $b); }
1998 sub dont_warn_31 { return ($a xor $b); }
1999 sub dont_warn_32 { die ($a or $b); }
2000 sub dont_warn_33 { die ($a and $b); }
2001 sub dont_warn_34 { die ($a xor $b); }
2002 sub dont_warn_35 { goto ($a or $b); }
2003 sub dont_warn_36 { goto ($a and $b); }
2004 sub dont_warn_37 { goto ($a xor $b); }
2005 sub dont_warn_38 { next ($a or $b) while(1); }
2006 sub dont_warn_39 { next ($a and $b) while(1); }
2007 sub dont_warn_40 { next ($a xor $b) while(1); }
2008 sub dont_warn_41 { last ($a or $b) while(1); }
2009 sub dont_warn_42 { last ($a and $b) while(1); }
2010 sub dont_warn_43 { last ($a xor $b) while(1); }
2011 sub dont_warn_44 { redo ($a or $b) while(1); }
2012 sub dont_warn_45 { redo ($a and $b) while(1); }
2013 sub dont_warn_46 { redo ($a xor $b) while(1); }
2016 use feature "signatures";
2020 $bbb = sub ($a) { 4 };
2022 The signatures feature is experimental at - line 3.
2023 The signatures feature is experimental at - line 5.
2025 no warnings "experimental::signatures";
2026 use feature "signatures";
2030 $bbb = sub ($a) { 4 };
2033 use warnings 'numeric';
2037 no warnings 'numeric';
2040 no warnings 'numeric';
2042 Negative repeat count does nothing at - line 3.
2043 Negative repeat count does nothing at - line 4.
2048 use warnings 'numeric';
2052 no warnings 'numeric';
2056 no warnings 'numeric';
2058 Non-finite repeat count does nothing at - line 5.
2059 Non-finite repeat count does nothing at - line 6.
2060 Non-finite repeat count does nothing at - line 7.
2062 # NAME warn on stat @array
2063 @foo = ("op/stat.t");
2069 use warnings 'syntax';
2074 Array passed to stat will be coerced to a scalar (did you want stat $foo[0]?) at - line 8.
2075 Array passed to stat will be coerced to a scalar (did you want stat $bar[0]?) at - line 9.
2076 Array passed to stat will be coerced to a scalar at - line 10.
2079 # NAME barewords and conditionals near constant folding
2081 my $x1 = !a || !b; # no "in conditional" warnings
2082 my $x2 = !A || !B; # warning-free, because upper-case won't clash
2084 Unquoted string "a" may clash with future reserved word at - line 2.
2085 Unquoted string "b" may clash with future reserved word at - line 2.