in reply to Re^2: reading from file.
in thread reading from file.

I noted there was insufficient information. I asked whether multiple attempts were allowed. I presented a clearly stated potential solution.

Allowing multiple attempts is the norm. I raised the absence of code to achieve this (i.e. while loop) along with a lack of any handling of a successful login attempt.

Both the array and hash solutions read the entire file; obviously, this is not something specific to the hash solution. The point I made was that this was only done once regardless of the number of attempts.

-- Ken

Replies are listed 'Best First'.
Re^4: reading from file.
by scripter87 (Novice) on Nov 14, 2013 at 10:46 UTC
    The code that I put up here isnt the exact code I am using. I generally just wanted the idea of what to do. Thats why it was typed. See I have a text file with the below data and must be done in that format, was reading into hashes seems the way to go, but will just arrays work to. The exact problem I have is. I am trying to ask a user for the username and password and retrieve them from the file and continue with the program if they validate.
    name1 pass1 name2 pass2