On Nov 9, birgit kellner said:

>for ($i = 0; $i < @inputarray; $i++) {

You use $i here...

>#we check all words of the input string in sequence
>       if ($inputarray[$i] eq $array[$i])  { #if the two words are identical, 
>percentage is 100
>               print "identical!\n";#checking
>                       push (@sum, 100); }
>       else    {
>               my ($percentage, $relevance);
>               print "not identical: $inputarray[$i] and $array[$i]\n";#checking
>               # if the two words are not identical
>               # check to what extent they have the same letters in the same positions
>               my @wordarray = split //, $inputarray[$i];
>               my @otherwordarray = split //, $array[$i];
>               for ($i = 0; $i < @wordarray; $i++) {

And here.  That's bad.

Either use different variables, or explicitly scope them:

  for (my $i = 0; ...; ...) {
    ...
    for (my $i = 0; ...; ...) {
      ...
    }
  }

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to