in reply to find the max fuzzy matching - perl
G'day corfuitl,
Welcome to the monastery.
As ww points out (above), if you don't tell us what the problem is, we're not in much of a position to advise how to fix whatever that problem might be. Read the guidelines in "How do I post a question effectively?" to find out how to get better answers. When you understand that, "How do I change/delete my post?" explains how to add the additional information to your original post.
Having said that, there are some basic problems with your code which you should address immediately. This exercise may fix whatever your problem is. Even if it doesn't, it'll certainly provide better information for us to help you.
Assuming you're attempting to declare these variables for use in the for loops, that's not the way to do it.
The reasons why are somewhat subtle and are explained in perlsyn: Foreach Loops: the typical gotcha occurs because values assigned to those variables within the loop are not visible outside the loop; the value of the variable will be the same before and after the loop regardless of how it might have been modified within the loop.
Don't worry if that's confusing or seems rather heavy going. Just declare your loop variables when you code your loop, like so:
for my $i (...) { # $i available (and localised to) here }
and for nested loops
for my $i (...) { # $i available (and localised to) here for my $j (...) { # The same $i available here # $j available (and localised to) here for my $k (...) { # The same $i and $j available here # $k available (and localised to) here } } }
-- Ken
|
|---|