Help for this page

Select Code to Download


  1. or download this
    for my $i (0 .. length($str1)) {
        if (substr($str1, $i, 1) ne substr($str2, $i, 1)) {
            $val++;
        }
    }
    
  2. or download this
    my $step = 5;
    my $bound = int (length($str1) / $step);
    
    ...
            $val++;
        }
    }
    
  3. or download this
    for my $i (0 .. $bound) {
        my $substr1 = substr($str1, ($i * $step), $step);
        my $substr2 = substr($str2, ($i * $step), $step);
    ...
            }
        }
    }