From: Joel Pearson Date: 2013-01-13T01:17:04+09:00 Subject: Re: How to take information from a text file and add them to an array If this is a username & password system then you'll want to pair them up, in which case I'd recommend storing them alongside each other and using a Hash to check a given user's password. In the current example you're giving, it looks as though someone could put in any user's password rather than their own and it would report back as valid. For example: users = %w{user1 user2} passwords = %w{pass1 pass2} #User1 enters a password but it's user2's not his own user = 'user1' pass = 'pass2' passwords.include? pass Returns true even though it's the wrong password for this user Whereas if you adopt an approach like this: users_passwords = { 'user1' => 'pass1', 'user2' => 'pass2' } user = 'user1' pass = 'pass2' users_passwords[user] == pass Returns false, which is right, that isn't his password. -- Posted via http://www.ruby-forum.com/.