http://www.perlmonks.org?node_id=1045983


in reply to Perl: How to perfectly match specific data between two files and do comparison?

use warning;

Should be:

use warnings;
$ncc = 0; $pc = 0; $fc = 0;

Should be:

my $ncc = 0; my $pc = 0; my $fc = 0;
sub fileA_ext() {

Should be:

sub fileA_ext {
while (@array = <FileA>) {

Should be:

my @array = <FileA>;
foreach $line(@array) {

Should be:

foreach my $line ( @array ) {
$name1 = "$1"; $score1 = "$12";

Should be:

$name1 = $1; $score1 = $12;
foreach $line (@tmp1) {

Should be:

foreach my $line ( @tmp1 ) {
my $name2 = "$1"; substr($name2, -13) = ''; my $score2 = "$12";

Should be:

my $name2 = $1; substr($name2, -13) = ''; my $score2 = $12;
sub FileB_ext() {

Should be:

sub FileB_ext {
while (@array = <FileB>) {

Should be:

my @array = <FileB>;
foreach $line(@array) {

Should be:

foreach my $line ( @array ) {
my $name3 = "$1"; my $score3 = "$12";

Should be:

my $name3 = $1; my $score3 = $12;
foreach $line (@tmp2) {

Should be:

foreach my $line ( @tmp2 ) {
my $name4 = "$1"; substr($name4, -13) = ''; my $score4 = "$12";

Should be:

my $name4 = $1; substr($name4, -13) = ''; my $score4 = $12;
sub check() {

Should be:

sub check {
foreach $data1 (@arr1) {

Should be:

foreach my $data1 ( @arr1 ) {
my $ep1 = "$1"; my $s1 = "$2";

Should be:

my $ep1 = $1; my $s1 = $2;
foreach $data2 (@arr2) {

Should be:

foreach my $data2 ( @arr2 ) {
my $ep2 = "$1"; my $s2 = "$2";

Should be:

my $ep2 = $1; my $s2 = $2;
if ( $ep1 eq $ep2 && $s1 =~ m/-/g) {

Should be:

if ( $ep1 eq $ep2 && $s1 =~ m/-/) {
if ( $ep1 eq $ep2 && $s1 !~ m/-/g && $s1 > 50 && $ +s2 > 40) {

Should be:

if ( $ep1 eq $ep2 && $s1 !~ m/-/ && $s1 > 50 && $s +2 > 40) {
if ( $ep1 eq $ep2 && $s1 !~ m/-/g && $s1 < 50 && $ +s2 < 40) {

Should be:

if ( $ep1 eq $ep2 && $s1 !~ m/-/ && $s1 < 50 && $s +2 < 40) {