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' ;
172 no warnings 'syntax' ;
178 Scalar value @a[3] better written as $a[3] at - line 3.
179 Scalar value @a{3} better written as $a{3} at - line 4.
180 Scalar value @a["]"] better written as $a["]"] at - line 5.
181 Scalar value @a{"]"} better written as $a{"]"} at - line 6.
182 Scalar value @a["}"] better written as $a["}"] at - line 7.
183 Scalar value @a{"}"} better written as $a{"}"} at - line 8.
184 Scalar value @a{...} better written as $a{...} at - line 9.
185 Scalar value @a{...} better written as $a{...} at - line 10.
186 Scalar value @a[...] better written as $a[...] at - line 11.
187 Scalar value @a[...] better written as $a[...] at - line 12.
188 Scalar value @a[...] better written as $a[...] at - line 13.
189 Scalar value @a{...} better written as $a{...} at - line 14.
193 use open qw( :utf8 :std );
194 use warnings 'syntax' ;
197 no warnings 'syntax' ;
201 Scalar value @à[3] better written as $à[3] at - line 5.
202 Scalar value @à{3} better written as $à{3} at - line 6.
206 use open qw( :utf8 :std );
207 use warnings 'syntax' ;
210 no warnings 'syntax' ;
214 Scalar value @ぁ[3] better written as $ぁ[3] at - line 5.
215 Scalar value @ぁ{3} better written as $ぁ{3} at - line 6.
218 # "Scalar value better written as" false positives
219 # [perl #28380] and [perl #114024]
220 use warnings 'syntax';
223 @h{qw"a b c"} = 1..3;
224 @h{qw'a b c'} = 1..3;
225 @h{qw$a b c$} = 1..3;
226 @h{qw-a b c-} = 1..3;
227 @h{qw#a b c#} = 1..3;
228 @h{ qw#a b c#} = 1..3;
229 @h{ qw#a b c#} = 1..3; # tab before qw
233 sub foo() { qw/abc def ghi/ }
234 @X{+foo} = ( 1 .. 3 );
235 $_ = "abc"; @X{split ""} = ( 1 .. 3 );
236 my @s = @f{"}", "a"};
237 my @s = @f{"]", "a"};
245 use constant phoo => 1..3;
260 @h[qw"a b c"] = 1..3;
261 @h[qw'a b c'] = 1..3;
262 @h[qw$a b c$] = 1..3;
263 @h[qw-a b c-] = 1..3;
264 @h[qw#a b c#] = 1..3;
265 @h[ qw#a b c#] = 1..3;
266 @h[ qw#a b c#] = 1..3; # tab before qw
270 sub foo() { qw/abc def ghi/ }
271 @X[+foo] = ( 1 .. 3 );
272 $_ = "abc"; @X[split ""] = ( 1 .. 3 );
273 my @s = @f["}", "a"];
274 my @s = @f["]", "a"];
282 use constant phoo => 1..3;
298 # "Scalar value better written as" should not trigger for syntax errors
299 use warnings 'syntax';
302 syntax error at - line 4, near "[]"
303 Execution of - aborted due to compilation errors.
310 Can't use a hash as a reference at - line 3.
317 Can't use a hash as a reference at - line 3.
324 Can't use an array as a reference at - line 3.
331 Can't use an array as a reference at - line 3.
335 $main::foo = {}; %$main::foo->{"bar"};
338 Can't use a hash as a reference at - line 3.
342 $foo = {}; %$foo->{"bar"};
345 Can't use a hash as a reference at - line 3.
349 $main::foo = []; @$main::foo->[34];
352 Can't use an array as a reference at - line 3.
356 $foo = []; @$foo->[34];
359 Can't use an array as a reference at - line 3.
362 use warnings 'void' ; no warnings 'experimental::smartmatch'; close STDIN ;
364 1 x 3 ; # OP_REPEAT (folded)
365 (1) x 3 ; # OP_REPEAT
367 wantarray ; # OP_WANTARRAY
377 defined $a ; # OP_DEFINED
380 length $a ; # OP_LENGTH
381 substr $a,1 ; # OP_SUBSTR
382 vec $a,1,2 ; # OP_VEC
383 index $a,1,2 ; # OP_INDEX
384 rindex $a,1,2 ; # OP_RINDEX
385 sprintf $a ; # OP_SPRINTF
389 #values %a ; # OP_VALUES
393 unpack "a", "a" ; # OP_UNPACK
394 pack $a,"" ; # OP_PACK
395 join "", @_ ; # OP_JOIN
396 (@a)[0,1] ; # OP_LSLICE
399 sort(1,2) ; # OP_SORT
400 reverse(1,2) ; # OP_REVERSE
405 fileno STDIN ; # OP_FILENO
407 tell STDIN ; # OP_TELL
408 readlink 1; # OP_READLINK
410 localtime ; # OP_LOCALTIME
412 eval { getgrnam 1 }; # OP_GGRNAM
413 eval { getgrgid 1 }; # OP_GGRGID
414 eval { getpwnam 1 }; # OP_GPWNAM
415 eval { getpwuid 1 }; # OP_GPWUID
416 prototype "foo"; # OP_PROTOTYPE
417 $a ~~ $b; # OP_SMARTMATCH
425 grep /42/, (1,2); # OP_GREP. Not warned about (yet). Grep git logs for void_unusual to see why...
427 Useless use of a constant ("111") in void context at - line 2.
428 Useless use of repeat (x) in void context at - line 3.
429 Useless use of wantarray in void context at - line 5.
430 Useless use of reference-type operator in void context at - line 12.
431 Useless use of reference constructor in void context at - line 13.
432 Useless use of single ref constructor in void context at - line 14.
433 Useless use of defined operator in void context at - line 15.
434 Useless use of hex in void context at - line 16.
435 Useless use of oct in void context at - line 17.
436 Useless use of length in void context at - line 18.
437 Useless use of substr in void context at - line 19.
438 Useless use of vec in void context at - line 20.
439 Useless use of index in void context at - line 21.
440 Useless use of rindex in void context at - line 22.
441 Useless use of sprintf in void context at - line 23.
442 Useless use of array element in void context at - line 24.
443 Useless use of array slice in void context at - line 26.
444 Useless use of hash element in void context at - line 29.
445 Useless use of hash slice in void context at - line 30.
446 Useless use of unpack in void context at - line 31.
447 Useless use of pack in void context at - line 32.
448 Useless use of join or string in void context at - line 33.
449 Useless use of list slice in void context at - line 34.
450 Useless use of sort in void context at - line 37.
451 Useless use of reverse in void context at - line 38.
452 Useless use of range (or flop) in void context at - line 41.
453 Useless use of caller in void context at - line 42.
454 Useless use of fileno in void context at - line 43.
455 Useless use of eof in void context at - line 44.
456 Useless use of tell in void context at - line 45.
457 Useless use of readlink in void context at - line 46.
458 Useless use of time in void context at - line 47.
459 Useless use of localtime in void context at - line 48.
460 Useless use of gmtime in void context at - line 49.
461 Useless use of getgrnam in void context at - line 50.
462 Useless use of getgrgid in void context at - line 51.
463 Useless use of getpwnam in void context at - line 52.
464 Useless use of getpwuid in void context at - line 53.
465 Useless use of subroutine prototype in void context at - line 54.
466 Useless use of smart match in void context at - line 55.
467 Useless use of numeric comparison (<=>) in void context at - line 56.
468 Useless use of a constant ("dsatrewq") in void context at - line 57.
469 Useless use of a constant ("diatrewq") in void context at - line 58.
470 Useless use of a constant ("igatrewq") in void context at - line 59.
471 Useless use of __SUB__ in void context at - line 61.
472 Useless use of anonymous array ([]) in void context at - line 62.
475 use warnings 'void' ; close STDIN ;
476 my $x = sort (2,1,3);
480 Useless use of sort in scalar context at - line 3.
483 no warnings 'void' ; close STDIN ;
486 wantarray ; # OP_WANTARRAY
496 defined $a ; # OP_DEFINED
499 length $a ; # OP_LENGTH
500 substr $a,1 ; # OP_SUBSTR
501 vec $a,1,2 ; # OP_VEC
502 index $a,1,2 ; # OP_INDEX
503 rindex $a,1,2 ; # OP_RINDEX
504 sprintf $a ; # OP_SPRINTF
508 #values %a ; # OP_VALUES
512 unpack "a", "a" ; # OP_UNPACK
513 pack $a,"" ; # OP_PACK
515 (@a)[0,1] ; # OP_LSLICE
518 sort(1,2) ; # OP_SORT
519 reverse(1,2) ; # OP_REVERSE
524 fileno STDIN ; # OP_FILENO
526 tell STDIN ; # OP_TELL
527 readlink 1; # OP_READLINK
529 localtime ; # OP_LOCALTIME
531 eval { getgrnam 1 }; # OP_GGRNAM
532 eval { getgrgid 1 }; # OP_GGRGID
533 eval { getpwnam 1 }; # OP_GPWNAM
534 eval { getpwuid 1 }; # OP_GPWUID
535 prototype "foo"; # OP_PROTOTYPE
539 use warnings 'void' ;
540 for (@{[0]}) { "$_" } # check warning isn't duplicated
542 for (@{[0]}) { "$_" } # check warning isn't duplicated
544 Useless use of string in void context at - line 3.
547 use warnings 'void' ;
550 if ( ! $Config{d_telldir}) {
553 # telldir not present
558 telldir 1 ; # OP_TELLDIR
560 telldir 1 ; # OP_TELLDIR
562 Useless use of telldir in void context at - line 13.
565 use warnings 'void' ;
568 if ( ! $Config{d_getppid}) {
571 # getppid not present
576 getppid ; # OP_GETPPID
578 getppid ; # OP_GETPPID
580 Useless use of getppid in void context at - line 13.
583 use warnings 'void' ;
586 if ( ! $Config{d_getpgrp}) {
589 # getpgrp not present
594 getpgrp ; # OP_GETPGRP
596 getpgrp ; # OP_GETPGRP
598 Useless use of getpgrp in void context at - line 13.
601 use warnings 'void' ;
604 if ( ! $Config{d_times}) {
616 Useless use of times in void context at - line 13.
619 use warnings 'void' ;
622 if ( ! $Config{d_getprior} or $^O eq 'os2') { # Locks before fixpak22
625 # getpriority not present
630 getpriority 1,2; # OP_GETPRIORITY
632 getpriority 1,2; # OP_GETPRIORITY
634 Useless use of getpriority in void context at - line 13.
637 use warnings 'void' ;
640 if ( ! $Config{d_getlogin}) {
643 # getlogin not present
648 getlogin ; # OP_GETLOGIN
650 getlogin ; # OP_GETLOGIN
652 Useless use of getlogin in void context at - line 13.
655 use warnings 'void' ;
657 if ( ! $Config{d_socket}) {
660 # getsockname not present
661 # getpeername not present
662 # gethostbyname not present
663 # gethostbyaddr not present
664 # gethostent not present
665 # getnetbyname not present
666 # getnetbyaddr not present
667 # getnetent not present
668 # getprotobyname not present
669 # getprotobynumber not present
670 # getprotoent not present
671 # getservbyname not present
672 # getservbyport not present
673 # getservent not present
677 getsockname STDIN ; # OP_GETSOCKNAME
678 getpeername STDIN ; # OP_GETPEERNAME
679 gethostbyname 1 ; # OP_GHBYNAME
680 gethostbyaddr 1,2; # OP_GHBYADDR
681 gethostent ; # OP_GHOSTENT
682 getnetbyname 1 ; # OP_GNBYNAME
683 getnetbyaddr 1,2 ; # OP_GNBYADDR
684 getnetent ; # OP_GNETENT
685 getprotobyname 1; # OP_GPBYNAME
686 getprotobynumber 1; # OP_GPBYNUMBER
687 getprotoent ; # OP_GPROTOENT
688 getservbyname 1,2; # OP_GSBYNAME
689 getservbyport 1,2; # OP_GSBYPORT
690 getservent ; # OP_GSERVENT
693 getsockname STDIN ; # OP_GETSOCKNAME
694 getpeername STDIN ; # OP_GETPEERNAME
695 gethostbyname 1 ; # OP_GHBYNAME
696 gethostbyaddr 1,2; # OP_GHBYADDR
697 gethostent ; # OP_GHOSTENT
698 getnetbyname 1 ; # OP_GNBYNAME
699 getnetbyaddr 1,2 ; # OP_GNBYADDR
700 getnetent ; # OP_GNETENT
701 getprotobyname 1; # OP_GPBYNAME
702 getprotobynumber 1; # OP_GPBYNUMBER
703 getprotoent ; # OP_GPROTOENT
704 getservbyname 1,2; # OP_GSBYNAME
705 getservbyport 1,2; # OP_GSBYPORT
706 getservent ; # OP_GSERVENT
708 # some functions may not be there, so we exit without running
712 Useless use of getsockname in void context at - line 24.
713 Useless use of getpeername in void context at - line 25.
714 Useless use of gethostbyname in void context at - line 26.
715 Useless use of gethostbyaddr in void context at - line 27.
716 Useless use of gethostent in void context at - line 28.
717 Useless use of getnetbyname in void context at - line 29.
718 Useless use of getnetbyaddr in void context at - line 30.
719 Useless use of getnetent in void context at - line 31.
720 Useless use of getprotobyname in void context at - line 32.
721 Useless use of getprotobynumber in void context at - line 33.
722 Useless use of getprotoent in void context at - line 34.
723 Useless use of getservbyname in void context at - line 35.
724 Useless use of getservbyport in void context at - line 36.
725 Useless use of getservent in void context at - line 37.
728 use warnings 'void' ;
739 Useless use of a variable in void context at - line 3.
740 Useless use of a variable in void context at - line 4.
741 Useless use of a variable in void context at - line 5.
742 Useless use of a variable in void context at - line 6.
745 use warnings 'void' ;
748 "x" . "y"; # optimized to OP_CONST
749 2 + 2; # optimized to OP_CONST
750 use constant U => undef;
753 5 || print "bad\n"; # test OPpCONST_SHORTCIRCUIT
754 print "boo\n" if U; # test OPpCONST_SHORTCIRCUIT
755 if($foo){}elsif(""){} # test OPpCONST_SHORTCIRCUIT
759 "x" . "y"; # optimized to OP_CONST
760 2 + 2; # optimized to OP_CONST
762 Useless use of a constant ("abc") in void context at - line 3.
763 Useless use of a constant (7) in void context at - line 4.
764 Useless use of a constant ("xy") in void context at - line 5.
765 Useless use of a constant (4) in void context at - line 6.
766 Useless use of a constant (undef) in void context at - line 8.
767 Useless use of a constant ("\"\t\n") in void context at - line 9.
771 if (ord('A') == 193) {
772 print "SKIPPED\n# Result varies depending on EBCDIC code page";
777 use open qw( :utf8 :std );
778 use warnings 'void' ;
781 Useless use of a constant ("\340\x{1e06}c") in void context at - line 11.
785 use open qw( :utf8 :std );
786 use warnings 'void' ;
787 "Ẋ" . "ƴ"; # optimized to OP_CONST
788 FOO; # Bareword optimized to OP_CONST
789 use constant ů => undef;
791 5 || print "bad\n"; # test OPpCONST_SHORTCIRCUIT
792 print "boo\n" if ů; # test OPpCONST_SHORTCIRCUIT
795 "Ẋ" . "ƴ"; # optimized to OP_CONST
797 Useless use of a constant ("\x{1e8a}\x{1b4}") in void context at - line 5.
798 Useless use of a constant ("\x{ff26}\x{ff2f}\x{ff2f}") in void context at - line 6.
799 Useless use of a constant (undef) in void context at - line 8.
803 use warnings 'misc' ; use utf8;
804 my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;my $d = 'test';
824 my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; my $d = 'test';
842 Applying pattern match (m//) to @a will act on scalar(@a) at - line 5.
843 Applying substitution (s///) to @a2 will act on scalar(@a2) at - line 6.
844 Applying transliteration (tr///) to @a3 will act on scalar(@a3) at - line 7.
845 Applying pattern match (m//) to @array will act on scalar(@array) at - line 8.
846 Applying substitution (s///) to @array will act on scalar(@array) at - line 9.
847 Applying transliteration (tr///) to @array will act on scalar(@array) at - line 10.
848 Applying pattern match (m//) to %a will act on scalar(%a) at - line 11.
849 Applying substitution (s///) to %a2 will act on scalar(%a2) at - line 12.
850 Applying transliteration (tr///) to %a3 will act on scalar(%a3) at - line 13.
851 Applying pattern match (m//) to %hash will act on scalar(%hash) at - line 14.
852 Applying substitution (s///) to %hash will act on scalar(%hash) at - line 15.
853 Applying transliteration (tr///) to %hash will act on scalar(%hash) at - line 16.
854 Useless use of /d modifier in transliteration operator at - line 17.
855 Replacement list is longer than search list at - line 18.
856 Useless use of /d modifier in transliteration operator at - line 20.
857 Replacement list is longer than search list at - line 21.
858 Can't modify array dereference in substitution (s///) at - line 6, near "s/a/b/ ;"
859 BEGIN not safe after errors--compilation aborted at - line 23.
862 use warnings 'parenthesis' ;
864 my @foo,%bar, $quux; # there's a TAB here
867 no warnings 'parenthesis' ;
870 Parentheses missing around "my" list at - line 3.
871 Parentheses missing around "my" list at - line 4.
874 use warnings 'parenthesis' ;
877 no warnings 'parenthesis' ;
880 Parentheses missing around "our" list at - line 3.
883 use warnings 'parenthesis' ;
884 local $a, $b = (1,2);
887 no warnings 'parenthesis' ;
888 local $c, $d = (1,2);
890 Parentheses missing around "local" list at - line 3.
891 Parentheses missing around "local" list at - line 4.
892 Parentheses missing around "local" list at - line 5.
895 use warnings 'bareword' ;
897 no warnings 'bareword' ;
900 Bareword found in conditional at - line 3.
906 use warnings 'misc' ;
908 $x = 1 if $x = <FH> ;
912 $x = 1 if $x = <FH> ;
916 Value of <HANDLE> construct can be "0"; test with defined() at - line 4.
917 Value of <HANDLE> construct can be "0"; test with defined() at - line 5.
920 use warnings 'misc' ;
922 $x = 1 if $x = readdir FH ;
926 $x = 1 if $x = readdir FH ;
931 Value of readdir() operator can be "0"; test with defined() at - line 4.
932 Value of readdir() operator can be "0"; test with defined() at - line 5.
935 use warnings 'misc' ;
944 Value of glob construct can be "0"; test with defined() at - line 3.
945 Value of glob construct can be "0"; test with defined() at - line 4.
948 use warnings 'misc' ;
950 $x = 1 if $x = each %a ;
952 $x = 1 if $x = each %a ;
954 Value of each() operator can be "0"; test with defined() at - line 4.
957 use warnings 'misc' ;
958 $x = 1 while $x = <*> and 0 ;
960 $x = 1 while $x = <*> and 0 ;
962 Value of glob construct can be "0"; test with defined() at - line 3.
965 use warnings 'misc' ;
967 $x = 1 while $x = readdir FH and 0 ;
969 $x = 1 while $x = readdir FH and 0 ;
972 Value of readdir() operator can be "0"; test with defined() at - line 4.
977 ($_ = <FH>) // ($_ = 1);
983 use warnings 'redefine' ;
986 sub fred { # warning should be for this line
988 no warnings 'redefine' ;
993 Subroutine fred redefined at - line 4.
994 Subroutine fred redefined at - line 5.
997 use warnings 'redefine' ;
1000 no warnings 'redefine' ;
1003 Constant subroutine fred redefined at - line 4.
1009 Constant subroutine fred redefined at - line 3.
1013 *fred = sub () { 2 };
1015 Constant subroutine main::fred redefined at - line 3.
1018 use feature "lexical_subs", "state";
1019 my sub fred () { 1 }
1022 sub george () { 2 } # should *not* produce redef warnings by default
1023 state sub phred () { 1 }
1025 state sub jorge { 1 }
1026 sub jorge () { 2 } # should *not* produce redef warnings by default
1028 Prototype mismatch: sub fred () vs none at - line 4.
1029 Constant subroutine fred redefined at - line 4.
1030 Prototype mismatch: sub george: none vs () at - line 6.
1031 Prototype mismatch: sub phred () vs none at - line 8.
1032 Constant subroutine phred redefined at - line 8.
1033 Prototype mismatch: sub jorge: none vs () at - line 10.
1036 no warnings 'redefine' ;
1042 no warnings 'redefine' ;
1044 *fred = sub () { 2 };
1048 use warnings 'redefine' ;
1053 no warnings 'redefine' ;
1057 Format FRED redefined at - line 5.
1060 use warnings 'exec' ;
1064 Statement unlikely to be reached at - line 4.
1065 (Maybe you meant system() when you said exec()?)
1067 # op.c, no warning if exec isn't a statement.
1068 use warnings 'exec' ;
1069 $a || exec "$^X -e 1" ;
1077 Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at - line 2.
1083 Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at - line 2.
1086 defined(@a = (1,2,3));
1093 Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at - line 2.
1099 Can't use 'defined(%hash)' (Maybe you should just omit the defined()?) at - line 2.
1102 no warnings 'exec' ;
1111 use constant foo=>bar; sub foo(@);
1112 use constant bav=>bar; sub bav(); # no warning
1115 Prototype mismatch: sub main::fred () vs ($) at - line 3.
1116 Prototype mismatch: sub foo () vs (@) at - line 4.
1117 Prototype mismatch: sub btu: none vs () at - line 6.
1121 use open qw( :utf8 :std );
1125 Prototype mismatch: sub main::frèd () vs ($) at - line 5.
1129 use open qw( :utf8 :std );
1131 eval "sub fòò (@\$\0) {}";
1133 Prototype after '@' for main::fòò : @$\0 at (eval 1) line 1.
1134 Illegal character in prototype for main::fòò : @$\0 at (eval 1) line 1.
1138 use open qw( :utf8 :std );
1140 eval "sub foo (@\0) {}";
1142 Prototype after '@' for main::foo : @\0 at (eval 1) line 1.
1143 Illegal character in prototype for main::foo : @\0 at (eval 1) line 1.
1147 if (ord('A') == 193) {
1148 print "SKIPPED\n# Different results on EBCDIC";
1153 use open qw( :utf8 :std );
1155 BEGIN { $::{"foo"} = "\@\$\0L\351on" }
1156 BEGIN { eval "sub foo (@\$\0L\x{c3}\x{a9}on) {}"; }
1158 Prototype after '@' for main::foo : @$\x{0}L... at (eval 1) line 1.
1159 Illegal character in prototype for main::foo : @$\x{0}L... at (eval 1) line 1.
1163 use open qw( :utf8 :std );
1165 BEGIN { eval "sub foo (@\0) {}"; }
1167 Prototype after '@' for main::foo : @\0 at (eval 1) line 1.
1168 Illegal character in prototype for main::foo : @\0 at (eval 1) line 1.
1172 eval "sub foo (@\xAB) {}";
1174 Prototype after '@' for main::foo : @\x{ab} at (eval 1) line 1.
1175 Illegal character in prototype for main::foo : @\x{ab} at (eval 1) line 1.
1179 use open qw( :utf8 :std );
1181 BEGIN { eval "sub foo (@\x{30cb}) {}"; }
1183 Prototype after '@' for main::foo : @\x{30cb} at (eval 1) line 1.
1184 Illegal character in prototype for main::foo : @\x{30cb} at (eval 1) line 1.
1188 use open qw( :utf8 :std );
1190 BEGIN { $::{"foo"} = "\x{30cb}" }
1191 BEGIN { eval "sub foo {}"; }
1193 Prototype mismatch: sub main::foo (ニ) vs none at (eval 1) line 1.
1200 no warnings 'prototype' ;
1203 use warnings 'prototype' ;
1210 Prototype mismatch: sub main::fred () vs ($) at - line 4.
1211 Prototype mismatch: sub main::freD () vs ($) at - line 11.
1212 Prototype mismatch: sub main::FRED () vs ($) at - line 14.
1214 # op.c [S_simplify_sort]
1216 my @tests = split /^/, '
1217 sort {$a <=> $b} @a;
1218 sort {$a cmp $b} @a;
1219 { use integer; sort {$a <=> $b} @a}
1220 sort {$b <=> $a} @a;
1221 sort {$b cmp $a} @a;
1222 { use integer; sort {$b <=> $a} @a}
1224 for my $pragma ('use warnings "syntax";', '') {
1225 for my $vars ('', 'my $a;', 'my $b;', 'my ($a,$b);') {
1226 for my $inner_stmt ('', 'print;', 'func();') {
1227 eval "#line " . ++$line . "01 -\n$pragma\n$vars"
1228 . join "", map s/sort \{\K/$inner_stmt/r, @tests;
1234 use warnings 'syntax';
1236 # These used to be errors!
1237 sort { ; } $a <=> $b;
1238 sort { ; } $a, "<=>";
1239 sort { ; } $a, $cmp;
1240 sort $a, $b if $cmpany_name;
1244 "my $a" used in sort comparison at - line 403.
1245 "my $a" used in sort comparison at - line 404.
1246 "my $a" used in sort comparison at - line 405.
1247 "my $a" used in sort comparison at - line 406.
1248 "my $a" used in sort comparison at - line 407.
1249 "my $a" used in sort comparison at - line 408.
1250 "my $a" used in sort comparison at - line 503.
1251 "my $a" used in sort comparison at - line 504.
1252 "my $a" used in sort comparison at - line 505.
1253 "my $a" used in sort comparison at - line 506.
1254 "my $a" used in sort comparison at - line 507.
1255 "my $a" used in sort comparison at - line 508.
1256 "my $a" used in sort comparison at - line 603.
1257 "my $a" used in sort comparison at - line 604.
1258 "my $a" used in sort comparison at - line 605.
1259 "my $a" used in sort comparison at - line 606.
1260 "my $a" used in sort comparison at - line 607.
1261 "my $a" used in sort comparison at - line 608.
1262 "my $b" used in sort comparison at - line 703.
1263 "my $b" used in sort comparison at - line 704.
1264 "my $b" used in sort comparison at - line 705.
1265 "my $b" used in sort comparison at - line 706.
1266 "my $b" used in sort comparison at - line 707.
1267 "my $b" used in sort comparison at - line 708.
1268 "my $b" used in sort comparison at - line 803.
1269 "my $b" used in sort comparison at - line 804.
1270 "my $b" used in sort comparison at - line 805.
1271 "my $b" used in sort comparison at - line 806.
1272 "my $b" used in sort comparison at - line 807.
1273 "my $b" used in sort comparison at - line 808.
1274 "my $b" used in sort comparison at - line 903.
1275 "my $b" used in sort comparison at - line 904.
1276 "my $b" used in sort comparison at - line 905.
1277 "my $b" used in sort comparison at - line 906.
1278 "my $b" used in sort comparison at - line 907.
1279 "my $b" used in sort comparison at - line 908.
1280 "my $a" used in sort comparison at - line 1003.
1281 "my $b" used in sort comparison at - line 1003.
1282 "my $a" used in sort comparison at - line 1004.
1283 "my $b" used in sort comparison at - line 1004.
1284 "my $a" used in sort comparison at - line 1005.
1285 "my $b" used in sort comparison at - line 1005.
1286 "my $b" used in sort comparison at - line 1006.
1287 "my $a" used in sort comparison at - line 1006.
1288 "my $b" used in sort comparison at - line 1007.
1289 "my $a" used in sort comparison at - line 1007.
1290 "my $b" used in sort comparison at - line 1008.
1291 "my $a" used in sort comparison at - line 1008.
1292 "my $a" used in sort comparison at - line 1103.
1293 "my $b" used in sort comparison at - line 1103.
1294 "my $a" used in sort comparison at - line 1104.
1295 "my $b" used in sort comparison at - line 1104.
1296 "my $a" used in sort comparison at - line 1105.
1297 "my $b" used in sort comparison at - line 1105.
1298 "my $b" used in sort comparison at - line 1106.
1299 "my $a" used in sort comparison at - line 1106.
1300 "my $b" used in sort comparison at - line 1107.
1301 "my $a" used in sort comparison at - line 1107.
1302 "my $b" used in sort comparison at - line 1108.
1303 "my $a" used in sort comparison at - line 1108.
1304 "my $a" used in sort comparison at - line 1203.
1305 "my $b" used in sort comparison at - line 1203.
1306 "my $a" used in sort comparison at - line 1204.
1307 "my $b" used in sort comparison at - line 1204.
1308 "my $a" used in sort comparison at - line 1205.
1309 "my $b" used in sort comparison at - line 1205.
1310 "my $b" used in sort comparison at - line 1206.
1311 "my $a" used in sort comparison at - line 1206.
1312 "my $b" used in sort comparison at - line 1207.
1313 "my $a" used in sort comparison at - line 1207.
1314 "my $b" used in sort comparison at - line 1208.
1315 "my $a" used in sort comparison at - line 1208.
1317 # op.c [S_simplify_sort]
1318 use warnings 'syntax'; use 5.01;
1320 sort { $a <=> $b } ();
1322 "state $a" used in sort comparison at - line 4.
1324 # op.c [Perl_ck_cmp]
1325 use warnings 'syntax' ;
1326 no warnings 'deprecated';
1363 $[ used in numeric lt (<) (did you mean $] ?) at - line 4.
1364 $[ used in numeric gt (>) (did you mean $] ?) at - line 5.
1365 $[ used in numeric le (<=) (did you mean $] ?) at - line 6.
1366 $[ used in numeric ge (>=) (did you mean $] ?) at - line 7.
1367 $[ used in numeric lt (<) (did you mean $] ?) at - line 8.
1368 $[ used in numeric gt (>) (did you mean $] ?) at - line 9.
1369 $[ used in numeric le (<=) (did you mean $] ?) at - line 10.
1370 $[ used in numeric ge (>=) (did you mean $] ?) at - line 11.
1371 $[ used in numeric lt (<) (did you mean $] ?) at - line 13.
1372 $[ used in numeric gt (>) (did you mean $] ?) at - line 14.
1373 $[ used in numeric le (<=) (did you mean $] ?) at - line 15.
1374 $[ used in numeric ge (>=) (did you mean $] ?) at - line 16.
1375 $[ used in numeric lt (<) (did you mean $] ?) at - line 17.
1376 $[ used in numeric gt (>) (did you mean $] ?) at - line 18.
1377 $[ used in numeric le (<=) (did you mean $] ?) at - line 19.
1378 $[ used in numeric ge (>=) (did you mean $] ?) at - line 20.
1380 # op.c [Perl_ck_length]
1381 use warnings 'syntax' ;
1390 length() used on @a (did you mean "scalar(@a)"?) at - line 3.
1391 length() used on %b (did you mean "scalar(keys %b)"?) at - line 4.
1392 length() used on @array (did you mean "scalar(@array)"?) at - line 5.
1393 length() used on %hash (did you mean "scalar(keys %hash)"?) at - line 6.
1394 length() used on %h (did you mean "scalar(keys %h)"?) at - line 8.
1395 length() used on @g (did you mean "scalar(@g)"?) at - line 9.
1398 use warnings 'syntax' ;
1399 join /---/, 'x', 'y', 'z';
1401 /---/ should probably be written as "---" at - line 3.
1405 use open qw( :utf8 :std );
1406 use warnings 'syntax' ;
1407 join /~~~/, 'x', 'y', 'z';
1409 /~~~/ should probably be written as "~~~" at - line 5.
1412 use warnings 'prototype' ;
1415 no warnings 'prototype' ;
1419 main::fred() called too early to check prototype at - line 3.
1421 # op.c [Perl_newATTRSUB]
1423 use warnings 'void' ;
1424 BEGIN { $| = 1; print "in begin\n"; }
1425 CHECK { print "in check\n"; }
1426 INIT { print "in init\n"; }
1427 END { print "in end\n"; }
1428 print "in mainline\n";
1432 delete $INC{"abc.pm"};
1441 Too late to run CHECK block at abc.pm line 3.
1442 Too late to run INIT block at abc.pm line 4.
1445 Too late to run CHECK block at abc.pm line 3.
1446 Too late to run INIT block at abc.pm line 4.
1452 # op.c [Perl_newATTRSUB]
1454 no warnings 'void' ;
1455 BEGIN { $| = 1; print "in begin\n"; }
1456 CHECK { print "in check\n"; }
1457 INIT { print "in init\n"; }
1458 END { print "in end\n"; }
1459 print "in mainline\n";
1462 BEGIN { unshift @INC, '.' }
1475 use warnings 'syntax' ;
1478 no warnings 'syntax' ;
1482 Useless use of push with no values at - line 4.
1483 Useless use of unshift with no values at - line 5.
1486 # 20020401 mjd@plover.com at suggestion of jfriedl@yahoo.com
1487 use warnings 'regexp';
1488 split /blah/g, "blah";
1489 no warnings 'regexp';
1490 split /blah/g, "blah";
1492 Use of /g modifier is meaningless in split at - line 4.
1494 use feature "bitwise";
1509 use warnings "experimental::bitwise";
1524 no warnings "experimental::bitwise";
1540 The bitwise feature is experimental at - line 2.
1541 The bitwise feature is experimental at - line 3.
1542 The bitwise feature is experimental at - line 4.
1543 The bitwise feature is experimental at - line 5.
1544 The bitwise feature is experimental at - line 6.
1545 The bitwise feature is experimental at - line 7.
1546 The bitwise feature is experimental at - line 8.
1547 The bitwise feature is experimental at - line 9.
1548 The bitwise feature is experimental at - line 10.
1549 The bitwise feature is experimental at - line 11.
1550 The bitwise feature is experimental at - line 12.
1551 The bitwise feature is experimental at - line 13.
1552 The bitwise feature is experimental at - line 14.
1553 The bitwise feature is experimental at - line 15.
1554 The bitwise feature is experimental at - line 17.
1555 The bitwise feature is experimental at - line 18.
1556 The bitwise feature is experimental at - line 19.
1557 The bitwise feature is experimental at - line 20.
1558 The bitwise feature is experimental at - line 21.
1559 The bitwise feature is experimental at - line 22.
1560 The bitwise feature is experimental at - line 23.
1561 The bitwise feature is experimental at - line 24.
1562 The bitwise feature is experimental at - line 25.
1563 The bitwise feature is experimental at - line 26.
1564 The bitwise feature is experimental at - line 27.
1565 The bitwise feature is experimental at - line 28.
1566 The bitwise feature is experimental at - line 29.
1567 The bitwise feature is experimental at - line 30.
1570 use warnings 'precedence';
1577 $a = $b <=> $c & $d;
1578 $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
1580 use experimental 'bitwise';
1587 $a = $b <=> $c & $d;
1588 $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
1589 $a = $b &. $c == $d;
1590 $a = $b ^. $c != $d;
1593 $a = $b >= $c ^. $d;
1594 $a = $b <= $c |. $d;
1595 $a = $b <=> $c &. $d;
1596 $a &.= $b == $c; $a |.= $b == $c; $a ^.= $b == $c; # shouldn't warn
1598 no warnings 'precedence';
1605 $a = $b <=> $c & $d;
1607 use experimental 'bitwise';
1614 $a = $b <=> $c & $d;
1615 $a &= $b == $c; $a |= $b == $c; $a ^= $b == $c; # shouldn't warn
1616 $a = $b &. $c == $d;
1617 $a = $b ^. $c != $d;
1620 $a = $b >= $c ^. $d;
1621 $a = $b <= $c |. $d;
1622 $a = $b <=> $c &. $d;
1623 $a &.= $b == $c; $a |.= $b == $c; $a ^.= $b == $c; # shouldn't warn
1626 Possible precedence problem on bitwise & operator at - line 3.
1627 Possible precedence problem on bitwise ^ operator at - line 4.
1628 Possible precedence problem on bitwise | operator at - line 5.
1629 Possible precedence problem on bitwise & operator at - line 6.
1630 Possible precedence problem on bitwise ^ operator at - line 7.
1631 Possible precedence problem on bitwise | operator at - line 8.
1632 Possible precedence problem on bitwise & operator at - line 9.
1633 Possible precedence problem on bitwise & operator at - line 13.
1634 Possible precedence problem on bitwise ^ operator at - line 14.
1635 Possible precedence problem on bitwise | operator at - line 15.
1636 Possible precedence problem on bitwise & operator at - line 16.
1637 Possible precedence problem on bitwise ^ operator at - line 17.
1638 Possible precedence problem on bitwise | operator at - line 18.
1639 Possible precedence problem on bitwise & operator at - line 19.
1640 Possible precedence problem on bitwise &. operator at - line 21.
1641 Possible precedence problem on bitwise ^. operator at - line 22.
1642 Possible precedence problem on bitwise |. operator at - line 23.
1643 Possible precedence problem on bitwise &. operator at - line 24.
1644 Possible precedence problem on bitwise ^. operator at - line 25.
1645 Possible precedence problem on bitwise |. operator at - line 26.
1646 Possible precedence problem on bitwise &. operator at - line 27.
1650 use warnings 'precedence';
1657 $a = $b <=> $c & $d;
1658 no warnings 'precedence';
1665 $a = $b <=> $c & $d;
1667 Possible precedence problem on bitwise & operator at - line 4.
1668 Possible precedence problem on bitwise ^ operator at - line 5.
1669 Possible precedence problem on bitwise | operator at - line 6.
1670 Possible precedence problem on bitwise & operator at - line 7.
1671 Possible precedence problem on bitwise ^ operator at - line 8.
1672 Possible precedence problem on bitwise | operator at - line 9.
1673 Possible precedence problem on bitwise & operator at - line 10.
1677 # ok => local() has desired effect;
1678 # ignore=> local() silently ignored
1680 use warnings 'syntax';
1682 local(undef); # OP_UNDEF ignore
1683 sub lval : lvalue {};
1684 local(lval()); # OP_ENTERSUB
1685 local($x **= 1); # OP_POW
1686 local($x *= 1); # OP_MULTIPLY
1687 local($x /= 1); # OP_DIVIDE
1688 local($x %= 1); # OP_MODULO
1689 local($x x= 1); # OP_REPEAT
1690 local($x += 1); # OP_ADD
1691 local($x -= 1); # OP_SUBTRACT
1692 local($x .= 1); # OP_CONCAT
1693 local($x <<= 1); # OP_LEFT_SHIFT
1694 local($x >>= 1); # OP_RIGHT_SHIFT
1695 local($x &= 1); # OP_BIT_AND
1696 local($x ^= 1); # OP_BIT_XOR
1697 local($x |= 1); # OP_BIT_OR
1700 local($x *= 1); # OP_I_MULTIPLY
1701 local($x /= 1); # OP_I_DIVIDE
1702 local($x %= 1); # OP_I_MODULO
1703 local($x += 1); # OP_I_ADD
1704 local($x -= 1); # OP_I_SUBTRACT
1706 local($x?$y:$z) = 1; # OP_COND_EXPR ok
1707 # these two are fatal run-time errors instead
1708 #local(@$a); # OP_RV2AV ok
1709 #local(%$a); # OP_RV2HV ok
1710 local(*a); # OP_RV2GV ok
1711 local(@a[1,2]); # OP_ASLICE ok
1712 local(@a{1,2}); # OP_HSLICE ok
1713 local(@a = (1,2)); # OP_AASSIGN
1714 local($$x); # OP_RV2SV ok
1715 local($#a); # OP_AV2ARYLEN
1716 local($x = 1); # OP_SASSIGN
1717 local($x &&= 1); # OP_ANDASSIGN
1718 local($x ||= 1); # OP_ORASSIGN
1719 local($x //= 1); # OP_DORASSIGN
1720 local($a[0]); # OP_AELEMFAST ok
1722 local(substr($x,0,1)); # OP_SUBSTR
1723 local(pos($x)); # OP_POS
1724 local(vec($x,0,1)); # OP_VEC
1725 local($a[$b]); # OP_AELEM ok
1726 local($a{$b}); # OP_HELEM ok
1728 no warnings 'syntax';
1730 Useless localization of subroutine entry at - line 10.
1731 Useless localization of exponentiation (**) at - line 11.
1732 Useless localization of multiplication (*) at - line 12.
1733 Useless localization of division (/) at - line 13.
1734 Useless localization of modulus (%) at - line 14.
1735 Useless localization of repeat (x) at - line 15.
1736 Useless localization of addition (+) at - line 16.
1737 Useless localization of subtraction (-) at - line 17.
1738 Useless localization of concatenation (.) or string at - line 18.
1739 Useless localization of left bitshift (<<) at - line 19.
1740 Useless localization of right bitshift (>>) at - line 20.
1741 Useless localization of bitwise and (&) at - line 21.
1742 Useless localization of bitwise xor (^) at - line 22.
1743 Useless localization of bitwise or (|) at - line 23.
1744 Useless localization of integer multiplication (*) at - line 26.
1745 Useless localization of integer division (/) at - line 27.
1746 Useless localization of integer modulus (%) at - line 28.
1747 Useless localization of integer addition (+) at - line 29.
1748 Useless localization of integer subtraction (-) at - line 30.
1749 Useless localization of list assignment at - line 39.
1750 Useless localization of array length at - line 41.
1751 Useless localization of scalar assignment at - line 42.
1752 Useless localization of logical and assignment (&&=) at - line 43.
1753 Useless localization of logical or assignment (||=) at - line 44.
1754 Useless localization of defined or assignment (//=) at - line 45.
1755 Useless localization of substr at - line 48.
1756 Useless localization of match position at - line 49.
1757 Useless localization of vec at - line 50.
1764 my ($x5,@x6, %x7) if 0;
1767 # these shouldn't warn
1771 if (my $w2) { $a=1 }
1772 if ($a && (my $w3 = 1)) {$a = 2}
1775 Deprecated use of my() in false conditional. This will be a fatal error in Perl 5.30 at - line 2.
1776 Deprecated use of my() in false conditional. This will be a fatal error in Perl 5.30 at - line 3.
1777 Deprecated use of my() in false conditional. This will be a fatal error in Perl 5.30 at - line 4.
1778 Deprecated use of my() in false conditional. This will be a fatal error in Perl 5.30 at - line 5.
1779 Deprecated use of my() in false conditional. This will be a fatal error in Perl 5.30 at - line 6.
1780 Deprecated use of my() in false conditional. This will be a fatal error in Perl 5.30 at - line 7.
1781 Deprecated use of my() in false conditional. This will be a fatal error in Perl 5.30 at - line 8.
1786 use warnings 'deprecated';
1789 no warnings 'deprecated';
1793 Use of assignment to $[ is deprecated at - line 2.
1794 Use of assignment to $[ is deprecated at - line 3.
1795 Use of assignment to $[ is deprecated at - line 5.
1796 Use of assignment to $[ is deprecated at - line 6.
1799 use warnings 'void';
1800 @x = split /y/, "z";
1801 $x = split /y/, "z";
1804 @x = split /y/, "z";
1805 $x = split /y/, "z";
1808 Useless use of split in void context at - line 5.
1811 use warnings 'redefine' ;
1813 use open qw( :utf8 :std );
1816 no warnings 'redefine' ;
1819 Subroutine frèd redefined at - line 6.
1822 use warnings 'redefine' ;
1824 use open qw( :utf8 :std );
1827 no warnings 'redefine' ;
1830 Constant subroutine frèd redefined at - line 6.
1834 use open qw( :utf8 :std );
1838 Constant subroutine frèd redefined at - line 5.
1842 use open qw( :utf8 :std );
1844 *frèd = sub () { 2 };
1846 Constant subroutine main::frèd redefined at - line 5.
1849 use warnings 'redefine' ;
1851 use open qw( :utf8 :std );
1854 no warnings 'redefine' ;
1857 Subroutine ᚠርƊ redefined at - line 6.
1860 use warnings 'redefine' ;
1862 use open qw( :utf8 :std );
1865 no warnings 'redefine' ;
1868 Constant subroutine ᚠርƊ redefined at - line 6.
1872 use open qw( :utf8 :std );
1876 Constant subroutine ᚠርƊ redefined at - line 5.
1880 use open qw( :utf8 :std );
1882 *ᚠርƊ = sub () { 2 };
1884 Constant subroutine main::ᚠርƊ redefined at - line 5.
1887 sub DynaLoader::dl_error {};
1889 # We're testing that the warnings report the same line number:
1890 eval <<'EOC' or die $@;
1892 DynaLoader::boot_DynaLoader("DynaLoader");
1895 eval <<'EOC' or die $@;
1897 DynaLoader::boot_DynaLoader("DynaLoader");
1903 \ASubroutine DynaLoader::dl_error redefined at \(eval 1\) line 2\.
1905 Subroutine DynaLoader::dl_error redefined at \(eval 2\) line 2\.
1909 sub do_warn_1 { return $a or $b; }
1910 sub do_warn_2 { return $a and $b; }
1911 sub do_warn_3 { return $a xor $b; }
1912 sub do_warn_4 { die $a or $b; }
1913 sub do_warn_5 { die $a and $b; }
1914 sub do_warn_6 { die $a xor $b; }
1915 sub do_warn_7 { exit $a or $b; }
1916 sub do_warn_8 { exit $a and $b; }
1917 sub do_warn_9 { exit $a xor $b; }
1919 # Since exit is an unary operator, it is even stronger than
1921 sub do_warn_10 { exit $a || $b; }
1922 sub do_warn_11 { exit $a && $b; }
1924 sub do_warn_12 { goto $a or $b; }
1925 sub do_warn_13 { goto $a and $b; }
1926 sub do_warn_14 { goto $a xor $b; }
1927 sub do_warn_15 { next $a or $b while(1); }
1928 sub do_warn_16 { next $a and $b while(1); }
1929 sub do_warn_17 { next $a xor $b while(1); }
1930 sub do_warn_18 { last $a or $b while(1); }
1931 sub do_warn_19 { last $a and $b while(1); }
1932 sub do_warn_20 { last $a xor $b while(1); }
1933 sub do_warn_21 { redo $a or $b while(1); }
1934 sub do_warn_22 { redo $a and $b while(1); }
1935 sub do_warn_23 { redo $a xor $b while(1); }
1936 # These get re-written to "(return/die $a) and $b"
1937 sub do_warn_24 { $b if return $a; }
1938 sub do_warn_25 { $b if die $a; }
1940 Possible precedence issue with control flow operator at - line 3.
1941 Possible precedence issue with control flow operator at - line 4.
1942 Possible precedence issue with control flow operator at - line 5.
1943 Possible precedence issue with control flow operator at - line 6.
1944 Possible precedence issue with control flow operator at - line 7.
1945 Possible precedence issue with control flow operator at - line 8.
1946 Possible precedence issue with control flow operator at - line 9.
1947 Possible precedence issue with control flow operator at - line 10.
1948 Possible precedence issue with control flow operator at - line 11.
1949 Possible precedence issue with control flow operator at - line 15.
1950 Possible precedence issue with control flow operator at - line 16.
1951 Possible precedence issue with control flow operator at - line 18.
1952 Possible precedence issue with control flow operator at - line 19.
1953 Possible precedence issue with control flow operator at - line 20.
1954 Possible precedence issue with control flow operator at - line 21.
1955 Possible precedence issue with control flow operator at - line 22.
1956 Possible precedence issue with control flow operator at - line 23.
1957 Possible precedence issue with control flow operator at - line 24.
1958 Possible precedence issue with control flow operator at - line 25.
1959 Possible precedence issue with control flow operator at - line 26.
1960 Possible precedence issue with control flow operator at - line 27.
1961 Possible precedence issue with control flow operator at - line 28.
1962 Possible precedence issue with control flow operator at - line 29.
1963 Possible precedence issue with control flow operator at - line 31.
1964 Possible precedence issue with control flow operator at - line 32.
1967 # (same as above, except these should not warn)
1968 use constant FEATURE => 1;
1969 use constant MISSING_FEATURE => 0;
1971 sub dont_warn_1 { MISSING_FEATURE and return or dont_warn_3(); }
1972 sub dont_warn_2 { FEATURE || return and dont_warn_3(); }
1973 sub dont_warn_3 { not FEATURE and return or dont_warn_3(); }
1974 sub dont_warn_4 { !MISSING_FEATURE || return and dont_warn_3(); }
1975 sub dont_warn_5 { MISSING_FEATURE and die or dont_warn_3(); }
1976 sub dont_warn_6 { FEATURE || die and dont_warn_3(); }
1977 sub dont_warn_7 { not FEATURE and die or dont_warn_3(); }
1978 sub dont_warn_8 { !MISSING_FEATURE || die and dont_warn_3(); }
1979 sub dont_warn_9 { MISSING_FEATURE and goto $a or dont_warn_3(); }
1980 sub dont_warn_10 { FEATURE || goto $a and dont_warn_3(); }
1981 sub dont_warn_11 { not FEATURE and goto $a or dont_warn_3(); }
1982 sub dont_warn_12 { !MISSING_FEATURE || goto $a and dont_warn_3(); }
1984 sub dont_warn_13 { MISSING_FEATURE and exit $a or dont_warn_3(); }
1985 sub dont_warn_14 { FEATURE || exit $a and dont_warn_3(); }
1986 sub dont_warn_15 { not FEATURE and exit $a or dont_warn_3(); }
1987 sub dont_warn_16 { !MISSING_FEATURE || exit $a and dont_warn_3(); }
1989 sub dont_warn_17 { MISSING_FEATURE and next or dont_warn_3() while(1); }
1990 sub dont_warn_18 { FEATURE || next and dont_warn_3() while(1); }
1991 sub dont_warn_19 { not FEATURE and next or dont_warn_3() while(1); }
1992 sub dont_warn_20 { !MISSING_FEATURE || next and dont_warn_3() while(1); }
1993 sub dont_warn_21 { MISSING_FEATURE and redo or dont_warn_3() while(1); }
1994 sub dont_warn_22 { FEATURE || redo and dont_warn_3() while(1); }
1995 sub dont_warn_23 { not FEATURE and redo or dont_warn_3() while(1); }
1996 sub dont_warn_24 { !MISSING_FEATURE || redo and dont_warn_3() while(1); }
1997 sub dont_warn_25 { MISSING_FEATURE and last or dont_warn_3() while(1); }
1998 sub dont_warn_26 { FEATURE || last and dont_warn_3() while(1); }
1999 sub dont_warn_27 { not FEATURE and last or dont_warn_3() while(1); }
2000 sub dont_warn_28 { !MISSING_FEATURE || last and dont_warn_3() while(1); }
2002 # These are weird, but at least not ambiguous.
2003 sub dont_warn_29 { return ($a or $b); }
2004 sub dont_warn_30 { return ($a and $b); }
2005 sub dont_warn_31 { return ($a xor $b); }
2006 sub dont_warn_32 { die ($a or $b); }
2007 sub dont_warn_33 { die ($a and $b); }
2008 sub dont_warn_34 { die ($a xor $b); }
2009 sub dont_warn_35 { goto ($a or $b); }
2010 sub dont_warn_36 { goto ($a and $b); }
2011 sub dont_warn_37 { goto ($a xor $b); }
2012 sub dont_warn_38 { next ($a or $b) while(1); }
2013 sub dont_warn_39 { next ($a and $b) while(1); }
2014 sub dont_warn_40 { next ($a xor $b) while(1); }
2015 sub dont_warn_41 { last ($a or $b) while(1); }
2016 sub dont_warn_42 { last ($a and $b) while(1); }
2017 sub dont_warn_43 { last ($a xor $b) while(1); }
2018 sub dont_warn_44 { redo ($a or $b) while(1); }
2019 sub dont_warn_45 { redo ($a and $b) while(1); }
2020 sub dont_warn_46 { redo ($a xor $b) while(1); }
2023 use feature "signatures";
2027 $bbb = sub ($a) { 4 };
2029 The signatures feature is experimental at - line 3.
2030 The signatures feature is experimental at - line 5.
2032 no warnings "experimental::signatures";
2033 use feature "signatures";
2037 $bbb = sub ($a) { 4 };
2040 use warnings 'numeric';
2044 no warnings 'numeric';
2047 no warnings 'numeric';
2049 Negative repeat count does nothing at - line 3.
2050 Negative repeat count does nothing at - line 4.
2053 my $non_ieee_fp = ($Config{doublekind} == 9 ||
2054 $Config{doublekind} == 10 ||
2055 $Config{doublekind} == 11);
2059 # No inf/nan support
2066 use warnings 'numeric';
2070 no warnings 'numeric';
2074 no warnings 'numeric';
2076 Non-finite repeat count does nothing at - line 16.
2077 Non-finite repeat count does nothing at - line 17.
2078 Non-finite repeat count does nothing at - line 18.
2080 # NAME warn on stat @array
2081 @foo = ("op/stat.t");
2087 use warnings 'syntax';
2092 Array passed to stat will be coerced to a scalar (did you want stat $foo[0]?) at - line 8.
2093 Array passed to stat will be coerced to a scalar (did you want stat $bar[0]?) at - line 9.
2094 Array passed to stat will be coerced to a scalar at - line 10.
2097 # NAME barewords and conditionals near constant folding
2099 my $x1 = !a || !b; # no "in conditional" warnings
2100 my $x2 = !A || !B; # warning-free, because upper-case won't clash
2102 Unquoted string "a" may clash with future reserved word at - line 2.
2103 Unquoted string "b" may clash with future reserved word at - line 2.
2105 # RT #6870: Odd parsing of do...for...
2106 # This was really more a tokenizer bug, but it manifests as spurious warnings
2108 no warnings 'reserved';