good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: duplicates getting omitted while comparing values inside foreach.by ELISHEVA (Prior) |
on Apr 16, 2009 at 07:48 UTC ( [id://757878]=note: print w/replies, xml ) | Need Help?? |
Btree (or lack thereof) isn't the reason for this bug. The bug is in the placement of your print OUT statements. If you clean up the indenting you will notice that lines only print out if
On the rows where it fails to print out, I presume that $variant is defined, but either the left or right flag is something other than 1. To fix this I recommend that you move the code for calculating the final column into a separate sub that returns either the file name or "-". Then your loop to read in file 2 should (pseudo code) look something like this:
Also, you might want to consider two changes to make this code more efficient.
Best, beth
In Section
Seekers of Perl Wisdom
|
|