No. I didn't look at your code. It's obviously too long and you said it didn't do what you wanted and I was only interested in the code on the rutgers.edu website so I made a program to wrap that into.
Just take the code I gave you, save it as a file, and copy the code from the rutgers.edu website into the calculate_protein_details sub that I gave you (except the first line (of the rutgers.edu code)). Then it just works. I tried it again, just now. If you want it to read the sequence from a fasta file, add that functionality afterwards, but that's a completely different 'problem'.
Remember: when things don't work you have to simplify till you understand why it doesn't.