in reply to Can you tell me why I get this error and if I can optimize my code somehow?
Start by trimming your input data in half until you find a minimal set of input that causes the issue.
If you don't see a bad entry in the input remaining, then sprinkle some print statements through your code, and see where and when that undef is appearing.
PS: If you rewrite
asfor($i=0; $i<=$#split_aligns_non_barrel; $i++) { $separate_hit_non_barrel=$split_aligns_non_barrel[$i]; ...
Then that would simplify your code a fair bit and make it easier to read. Fewer pseudo-global variables and unnecessary worrying about indexes is good too.for my $separate_hit_non_barrel (@split_aligns_non_barrel) { ...
|
|---|