and it works :)$good=0; $bad=0; while ((defined ($line1 = <INPUT1>)) && (defined ($line2 = <INPUT2>))) { @words1 = split(/ /, $line1); @words2 = split(/ /, $line2); $wordsno = @words2; until ($wordsno-- == 0){ if ($words1[$wordsno] eq $words2[$wordsno]) { $good++; } else {$bad++;} } } print "good: $good"; print "bad: $bad"; close INPUT1; close INPUT2;
In reply to compare files by words by jajaja
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |