----- Original Message -----
From: "maureen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>

> Currently, the array seems to only be picking up the last name listed in
> the text file.

> @indata = <FILE>;
> close(FILE);
> foreach $i (@indata)
> {
> #remove hard return character from each record
> chomp($i);
> #split fields on pipe character
> #assign a variable name to each of the fields
> ($username,$password) = split(/\|/,$i);
> }
<snip off>
> #check for proper password
> if ($username!=~/$in{'username'}/)
> {
> #invalid password--create error message and exit
> print &PrintHeader;

In the foreach loop, after iteration, $username,$password received the last
line of the file. What you really want is to check
$in{'username'} against every line of the file, to do this, you must check
within the foreach loop like this :-

foreach $i (@indata){
             chomp $i;
             ($username,$password) = split(/\|/,$i);
             if ($username !~ /$in{username}/) {
                # I would prefer to use ne instead of !~
                #invalid password--create error message and exit
                print &PrintHeader;
                .......
             };
};







_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to