in reply to comparing array elements

That's a FAQ. perldoc -q intersection.

Abigail

Replies are listed 'Best First'.
Re: Re: comparing array elements
by Anonymous Monk on Nov 21, 2003 at 09:33 UTC
    Hi Abigail-II, the problem is that intersection works on the whole list, I need to work on individual elements in the same position.
      At first, I thought that too. But then you were considering to use a hash.

      What have you tried so far?

      Abigail

        the hash backfired! so i'm using a for loop. (little success so far) my comparison operator isn't working (both arrays contain 4- letter words) and i just need to determine which words are contained in the same position in each array.

        thanks for helping!

        for (my $i =0; $i < @forward_tets; $i++) { if ($forward_tets[$i] =~ $reverse_tets[$i]) { print "$forward_tets[$i] \t $reverse_tets[$i]\n" +; } }