my $count=0; for ( my $i=0; $i <($#a+1);$i++) { if ( $a[$i] != $b[$i] ) { $count++; } } print $count;