  op.c		AOK

     "my" variable %s masks earlier declaration in same scope
	my $x;
	my $x ;

     Variable "%s" may be unavailable 
	sub x {
      	    my $x;
      	    sub y {
         	$x
      	    }
   	}

     Variable "%s" will not stay shared 
	sub x {
      	    my $x;
      	    sub y {
         	sub { $x }
      	    }
   	}

     Found = in conditional, should be ==
	1 if $a = 1 ;

     Use of implicit split to @_ is deprecated
	split ;

     Use of implicit split to @_ is deprecated
	$a = split ;

     Useless use of time in void context
     Useless use of a variable in void context
     Useless use of a constant in void context
	time ;
	$a ;
	"abc"

     Applying %s to %s will act on scalar(%s)
	my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
	@a =~ /abc/ ;
	@a =~ s/a/b/ ;
	@a =~ tr/a/b/ ;
	@$b =~ /abc/ ;
	@$b =~ s/a/b/ ;
	@$b =~ tr/a/b/ ;
	%a =~ /abc/ ;
	%a =~ s/a/b/ ;
	%a =~ tr/a/b/ ;
	%$c =~ /abc/ ;
	%$c =~ s/a/b/ ;
	%$c =~ tr/a/b/ ;


     Parens missing around "my" list at -e line 1.
       my $a, $b = (1,2);
 
     Parens missing around "local" list at -e line 1.
       local $a, $b = (1,2);
 
     Probable precedence problem on logical or at -e line 1.
       use warning 'syntax'; my $x = print(ABC || 1);
 
     Value of %s may be \"0\"; use \"defined\" 
	$x = 1 if $x = <FH> ;
	$x = 1 while $x = <FH> ;

     Subroutine fred redefined at -e line 1.
       sub fred{1;} sub fred{1;}
 
     Constant subroutine %s redefined 
        sub fred() {1;} sub fred() {1;}
 
     Format FRED redefined at /tmp/x line 5.
       format FRED =
       .
       format FRED =
       .
 
     Array @%s missing the @ in argument %d of %s() 
	push fred ;
 
     Hash %%%s missing the %% in argument %d of %s() 
	keys joe ;
 
     Statement unlikely to be reached
     (Maybe you meant system() when you said exec()?
 	exec "true" ; my $a


__END__
# op.c
use warning 'unsafe' ;
my $x ;
my $x ;
EXPECT
"my" variable $x masks earlier declaration in same scope at - line 4.
########
# op.c
use warning 'unsafe' ;
sub x {
      my $x;
      sub y {
         $x
      }
   }
EXPECT
Variable "$x" will not stay shared at - line 7.
########
# op.c
use warning 'unsafe' ;
sub x {
      my $x;
      sub y {
         sub { $x }
      }
   }
EXPECT
Variable "$x" may be unavailable at - line 6.
########
# op.c
use warning 'syntax' ;
1 if $a = 1 ;
EXPECT
Found = in conditional, should be == at - line 3.
########
# op.c
use warning 'deprecated' ;
split ;
EXPECT
Use of implicit split to @_ is deprecated at - line 3.
########
# op.c
use warning 'deprecated' ;
$a = split ;
EXPECT
Use of implicit split to @_ is deprecated at - line 3.
########
# op.c
use warning 'void' ; close STDIN ;
1 x 3 ;			# OP_REPEAT
			# OP_GVSV
wantarray ; 		# OP_WANTARRAY
			# OP_GV
			# OP_PADSV
			# OP_PADAV
			# OP_PADHV
			# OP_PADANY
			# OP_AV2ARYLEN
ref ;			# OP_REF
\@a ;			# OP_REFGEN
\$a ;			# OP_SREFGEN
defined $a ;		# OP_DEFINED
hex $a ;		# OP_HEX
oct $a ;		# OP_OCT
length $a ;		# OP_LENGTH
substr $a,1 ;		# OP_SUBSTR
vec $a,1,2 ;		# OP_VEC
index $a,1,2 ;		# OP_INDEX
rindex $a,1,2 ;		# OP_RINDEX
sprintf $a ;		# OP_SPRINTF
$a[0] ;			# OP_AELEM
			# OP_AELEMFAST
@a[0] ;			# OP_ASLICE
#values %a ;		# OP_VALUES
#keys %a ;		# OP_KEYS
$a{0} ;			# OP_HELEM
@a{0} ;			# OP_HSLICE
unpack "a", "a" ;	# OP_UNPACK
pack $a,"" ;		# OP_PACK
join "" ;		# OP_JOIN
(@a)[0,1] ;		# OP_LSLICE
			# OP_ANONLIST
			# OP_ANONHASH
sort(1,2) ;		# OP_SORT
reverse(1,2) ;		# OP_REVERSE
			# OP_RANGE
			# OP_FLIP
(1 ..2) ;		# OP_FLOP
caller ;		# OP_CALLER
fileno STDIN ;		# OP_FILENO
eof STDIN ;		# OP_EOF
tell STDIN ;		# OP_TELL
readlink 1;		# OP_READLINK
time ;			# OP_TIME
localtime ;		# OP_LOCALTIME
gmtime ;		# OP_GMTIME
eval { getgrnam 1 };	# OP_GGRNAM
eval { getgrgid 1 };	# OP_GGRGID
eval { getpwnam 1 };	# OP_GPWNAM
eval { getpwuid 1 };	# OP_GPWUID
EXPECT
Useless use of repeat in void context at - line 3.
Useless use of wantarray in void context at - line 5.
Useless use of reference-type operator in void context at - line 12.
Useless use of reference constructor in void context at - line 13.
Useless use of scalar ref constructor in void context at - line 14.
Useless use of defined operator in void context at - line 15.
Useless use of hex in void context at - line 16.
Useless use of oct in void context at - line 17.
Useless use of length in void context at - line 18.
Useless use of substr in void context at - line 19.
Useless use of vec in void context at - line 20.
Useless use of index in void context at - line 21.
Useless use of rindex in void context at - line 22.
Useless use of sprintf in void context at - line 23.
Useless use of array element in void context at - line 24.
Useless use of array slice in void context at - line 26.
Useless use of hash elem in void context at - line 29.
Useless use of hash slice in void context at - line 30.
Useless use of unpack in void context at - line 31.
Useless use of pack in void context at - line 32.
Useless use of join in void context at - line 33.
Useless use of list slice in void context at - line 34.
Useless use of sort in void context at - line 37.
Useless use of reverse in void context at - line 38.
Useless use of range (or flop) in void context at - line 41.
Useless use of caller in void context at - line 42.
Useless use of fileno in void context at - line 43.
Useless use of eof in void context at - line 44.
Useless use of tell in void context at - line 45.
Useless use of readlink in void context at - line 46.
Useless use of time in void context at - line 47.
Useless use of localtime in void context at - line 48.
Useless use of gmtime in void context at - line 49.
Useless use of getgrnam in void context at - line 50.
Useless use of getgrgid in void context at - line 51.
Useless use of getpwnam in void context at - line 52.
Useless use of getpwuid in void context at - line 53.
########
# op.c
use warning 'void' ;
use Config ;
BEGIN {
    if ( ! $Config{d_telldir}) {
        print <<EOM ;
SKIPPED
# telldir not present
EOM
        exit 
    }
}
telldir 1 ;		# OP_TELLDIR
EXPECT
Useless use of telldir in void context at - line 13.
########
# op.c
use warning 'void' ;
use Config ;
BEGIN {
    if ( ! $Config{d_getppid}) {
        print <<EOM ;
SKIPPED
# getppid not present
EOM
        exit 
    }
}
getppid ;		# OP_GETPPID
EXPECT
Useless use of getppid in void context at - line 13.
########
# op.c
use warning 'void' ;
use Config ;
BEGIN {
    if ( ! $Config{d_getpgrp}) {
        print <<EOM ;
SKIPPED
# getpgrp not present
EOM
        exit 
    }
}
getpgrp ;		# OP_GETPGRP
EXPECT
Useless use of getpgrp in void context at - line 13.
########
# op.c
use warning 'void' ;
use Config ;
BEGIN {
    if ( ! $Config{d_times}) {
        print <<EOM ;
SKIPPED
# times not present
EOM
        exit 
    }
}
times ;			# OP_TMS
EXPECT
Useless use of times in void context at - line 13.
########
# op.c
use warning 'void' ;
use Config ;
BEGIN {
    if ( ! $Config{d_getprior} or $^O eq 'os2') { # Locks before fixpak22
        print <<EOM ;
SKIPPED
# getpriority not present
EOM
        exit 
    }
}
getpriority 1,2;	# OP_GETPRIORITY
EXPECT
Useless use of getpriority in void context at - line 13.
########
# op.c
use warning 'void' ;
use Config ;
BEGIN {
    if ( ! $Config{d_getlogin}) {
        print <<EOM ;
SKIPPED
# getlogin not present
EOM
        exit 
    }
}
getlogin ;			# OP_GETLOGIN
EXPECT
Useless use of getlogin in void context at - line 13.
########
# op.c
use warning 'void' ;
use Config ; BEGIN {
if ( ! $Config{d_socket}) {
    print <<EOM ;
SKIPPED
# getsockname not present
# getpeername not present
# gethostbyname not present
# gethostbyaddr not present
# gethostent not present
# getnetbyname not present
# getnetbyaddr not present
# getnetent not present
# getprotobyname not present
# getprotobynumber not present
# getprotoent not present
# getservbyname not present
# getservbyport not present
# getservent not present
EOM
    exit 
} }
getsockname STDIN ;	# OP_GETSOCKNAME
getpeername STDIN ;	# OP_GETPEERNAME
gethostbyname 1 ;	# OP_GHBYNAME
gethostbyaddr 1,2;	# OP_GHBYADDR
gethostent ;		# OP_GHOSTENT
getnetbyname 1 ;	# OP_GNBYNAME
getnetbyaddr 1,2 ;	# OP_GNBYADDR
getnetent ;		# OP_GNETENT
getprotobyname 1;	# OP_GPBYNAME
getprotobynumber 1;	# OP_GPBYNUMBER
getprotoent ;		# OP_GPROTOENT
getservbyname 1,2;	# OP_GSBYNAME
getservbyport 1,2;	# OP_GSBYPORT
getservent ;		# OP_GSERVENT
INIT {
   # some functions may not be there, so we exit without running
   exit;
}
EXPECT
Useless use of getsockname in void context at - line 24.
Useless use of getpeername in void context at - line 25.
Useless use of gethostbyname in void context at - line 26.
Useless use of gethostbyaddr in void context at - line 27.
Useless use of gethostent in void context at - line 28.
Useless use of getnetbyname in void context at - line 29.
Useless use of getnetbyaddr in void context at - line 30.
Useless use of getnetent in void context at - line 31.
Useless use of getprotobyname in void context at - line 32.
Useless use of getprotobynumber in void context at - line 33.
Useless use of getprotoent in void context at - line 34.
Useless use of getservbyname in void context at - line 35.
Useless use of getservbyport in void context at - line 36.
Useless use of getservent in void context at - line 37.
########
# op.c
use warning 'void' ;
*a ; # OP_RV2GV
$a ; # OP_RV2SV
@a ; # OP_RV2AV
%a ; # OP_RV2HV
EXPECT
Useless use of a variable in void context at - line 3.
Useless use of a variable in void context at - line 4.
Useless use of a variable in void context at - line 5.
Useless use of a variable in void context at - line 6.
########
# op.c
use warning 'void' ;
"abc"; # OP_CONST
7 ; # OP_CONST
EXPECT
Useless use of a constant in void context at - line 3.
Useless use of a constant in void context at - line 4.
########
# op.c
use warning 'unsafe' ;
my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ;
@a =~ /abc/ ;
@a =~ s/a/b/ ;
@a =~ tr/a/b/ ;
@$b =~ /abc/ ;
@$b =~ s/a/b/ ;
@$b =~ tr/a/b/ ;
%a =~ /abc/ ;
%a =~ s/a/b/ ;
%a =~ tr/a/b/ ;
%$c =~ /abc/ ;
%$c =~ s/a/b/ ;
%$c =~ tr/a/b/ ;
EXPECT
Applying pattern match to @array will act on scalar(@array) at - line 4.
Applying substitution to @array will act on scalar(@array) at - line 5.
Can't modify private array in substitution at - line 5, near "s/a/b/ ;"
Applying character translation to @array will act on scalar(@array) at - line 6.
Applying pattern match to @array will act on scalar(@array) at - line 7.
Applying substitution to @array will act on scalar(@array) at - line 8.
Applying character translation to @array will act on scalar(@array) at - line 9.
Applying pattern match to %hash will act on scalar(%hash) at - line 10.
Applying substitution to %hash will act on scalar(%hash) at - line 11.
Applying character translation to %hash will act on scalar(%hash) at - line 12.
Applying pattern match to %hash will act on scalar(%hash) at - line 13.
Applying substitution to %hash will act on scalar(%hash) at - line 14.
Applying character translation to %hash will act on scalar(%hash) at - line 15.
Execution of - aborted due to compilation errors.
########
# op.c
use warning 'syntax' ;
my $a, $b = (1,2);
EXPECT
Parens missing around "my" list at - line 3.
########
# op.c
use warning 'syntax' ;
local $a, $b = (1,2);
EXPECT
Parens missing around "local" list at - line 3.
########
# op.c
use warning 'syntax' ;
print (ABC || 1) ;
EXPECT
Probable precedence problem on logical or at - line 3.
########
--FILE-- abc

--FILE--
# op.c
use warning 'unsafe' ;
open FH, "<abc" ;
$x = 1 if $x = <FH> ;
EXPECT
Value of <HANDLE> construct can be "0"; test with defined() at - line 4.
########
# op.c
use warning 'unsafe' ;
opendir FH, "." ;
$x = 1 if $x = readdir FH ;
closedir FH ;
EXPECT
Value of readdir() operator can be "0"; test with defined() at - line 4.
########
# op.c
use warning 'unsafe' ;
$x = 1 if $x = <*> ;
EXPECT
Value of glob construct can be "0"; test with defined() at - line 3.
########
# op.c
use warning 'unsafe' ;
%a = (1,2,3,4) ;
$x = 1 if $x = each %a ;
EXPECT
Value of each() operator can be "0"; test with defined() at - line 4.
########
# op.c
use warning 'unsafe' ;
$x = 1 while $x = <*> and 0 ;
EXPECT
Value of glob construct can be "0"; test with defined() at - line 3.
########
# op.c
use warning 'unsafe' ;
opendir FH, "." ;
$x = 1 while $x = readdir FH and 0 ;
closedir FH ;
EXPECT
Value of readdir() operator can be "0"; test with defined() at - line 4.
########
# op.c
use warning 'redefine' ;
sub fred {}
sub fred {}
EXPECT
Subroutine fred redefined at - line 4.
########
# op.c
use warning 'redefine' ;
sub fred () { 1 }
sub fred () { 1 }
EXPECT
Constant subroutine fred redefined at - line 4.
########
# op.c
use warning 'redefine' ;
format FRED =
.
format FRED =
.
EXPECT
Format FRED redefined at - line 5.
########
# op.c
use warning 'syntax' ;
push FRED;
EXPECT
Array @FRED missing the @ in argument 1 of push() at - line 3.
########
# op.c
use warning 'syntax' ;
@a = keys FRED ;
EXPECT
Hash %FRED missing the % in argument 1 of keys() at - line 3.
########
# op.c
use warning 'syntax' ;
exec "$^X -e 1" ; 
my $a
EXPECT
Statement unlikely to be reached at - line 4.
(Maybe you meant system() when you said exec()?)
