in reply to How to do a reciprocal matching statement

Hi ajl412860, please post a small sample of your input data and what you expect as output. Post the samples inside <code></code>tags. You can edit your original post.

Here's a couple of things from one section of your program that you could address in the meantime:

foreach my $a (@a){ # print $a."\n"; my @b = split(/[.]/,$a); #print @b.$n; #print $b[0].$n.$b[1].$n.$b[2].$n.$b[3].$n.$b[4].$n.$b[5].$n.$b[6].$ +n.$b[7]; my $OrginalBlast; $OrginalBlast = $b[0].".".$b[1].".".$b[2].".".$b[3].".".$b[4].".".$b +[5].".".$b[6].".".$b +[7];
  1. Give your variables meaningful names. It's false economy to use one-letter variable names; much better to name the variable so that it tells you what it is when you look at it in your code. Also, you shouldn't use $a or $b, as they are special reserved variable names.
  2. You can just declare a variable the first time you use it. No need to do:
    my $foo; $foo = 'bar';
    . . . just do:
    my $foo = 'bar';
  3. If you want to join a bunch of variables together with a certain string in between, use join. As in:
    my $str = join '; ', $foo, $bar, $baz, $qux;
  4. You seem to be splitting the line on a dot, then reassembling the parts, again on a dot (for which you should use join). That serves no purpose as far as I can see.
  5. So you could probably better write the above code as:
    foreach my $OriginalBlast (@files) {
    . . . I'm afraid as graff points out the rest of your program has similar ineffectual code. If you post your input data and what you want to get out, we'll be able to help you. But you really should read up on some basics, such as opening and reading files, perlintro, perlfaq and so on. You might want to set aside this program for now and spend some time with the most simple program you can write, in a test directory, opening, reading and writing to the most simple files you can create.

    The way forward always starts with a minimal test.