in reply to username/password validation

Here's my guess. The file that contains the id/password is a one-line file that does not have a newline character at the end. Therefore when you chop the line of text it removes the last letter from the encrypted password instead of the trailing newline, because there is none. The solution is to use chomp instead of chop. Open the file in a text editor to see if I'm right. I'll bet that final "Q" is there after all.