Ahh, after looking at my code for an hour straight (literally, my eyes stayed on the screen on my PowerBook without moving), I found my elusive bug. Guess what it was?
Yep, I had used an '<=" instead of a '<' in my while loop all this code is in, causing my code to overshoot my 'protein_matrix' and throw undefined errors.
This little bug has caused me like 3 days........grrrrrr
You guys are great though. Thanks. I've learned a lot of valuable debugging routes from this thread...
By the way: Does perl have exception handling?