barrymcv has asked for the wisdom of the Perl Monks concerning the following question:
#!/Perl/bin/perl.exe print "content-type: text/html \n\n"; $projectA = (OPEN, c:\projecta.txt); $projectB = (OPEN, c:\projectb.txt); $MatchCount = 0; @sentencesA = split(/\./, $projectA); @sentencesB = split(/\./, $projectB); $arrLenA = scalar @sentencesA; $arrLenB = scalar @sentencesB; for ($z=0;$z<=$arrLenA;$z++){ for ($i=0;$i<=$arrLenB;$i++){ if $sentencesA[$i] == $setencesB[$z]{ $MatchCount++; } } } return $MatchCount;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: compare 2 files and return the number of similar sentences
by moklevat (Priest) on Apr 20, 2007 at 13:10 UTC | |
|
Re: compare 2 files and return the number of similar sentences
by derby (Abbot) on Apr 20, 2007 at 13:35 UTC | |
|
Re: compare 2 files and return the number of similar sentences
by Krambambuli (Curate) on Apr 20, 2007 at 13:28 UTC | |
by barrymcv (Initiate) on Apr 20, 2007 at 13:36 UTC | |
|
Re: compare 2 files and return the number of similar sentences
by zentara (Cardinal) on Apr 20, 2007 at 13:58 UTC |