I don't completely understand your requirements either, but I'll take a stab. You'll probably end up with multiple arrays of arrays, right -- one for each unique value in the first column? In other words, for the value KN-1791-LAST_rep_c7834 you could have an array of arrays, but then there will be another for the next different value found in column 1, and so on. In that case, I suspect you really want a hash of arrays of arrays (HoAoA), keyed on that column 1 value. Or perhaps, once you've built an array of arrays for a particular column 1 value, you can go ahead and print it out or do whatever you need to do with it, and be done with it? I can't really tell.
It's also not clear what you mean by "a difference of 10", since you didn't give an example like that, and I don't know what you mean by a "false positive." Maybe you could give a longer sample of your input data (10-12 lines) and what you would expect the output to look like, and get some advice on the best way to get there.
One likely problem, code-wise: this line (below) doesn't make an array of arrays, as you may be expecting. It pushes the values in the second array onto the end of the first array, leaving it one-dimensional. To get an array of arrays, you would push a reference to your sub-array onto the first one, like in my second line:
push (@arrayEquals, @array); # just makes the array longer push @arrayEquals, [@array]; # makes an array of arrays
Aaron B.
Available for small or large Perl jobs; see my home node.
In reply to Re: Accessing 2D array values and comparing
by aaron_baugher
in thread Accessing 2D array values and comparing
by mSe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |