if ($sentencesA[$z] eq $setencesB{$i}){
You seem to be confusing curly braces with square brackets. Plus, "setences" should probably be "sentences". These mistakes would not have happened with strict and warnings.
I cannot test that code because I don't know what is in the variables.
Maybe List::Compare is the best solution to your problem.
Update: Changed List::Util to List::CompareIn reply to Re: Comparing 2 arrays too find the total number of identical elements.
by betterworld
in thread Comparing 2 arrays too find the total number of identical elements.
by barrymcv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |