Hello,
Here is code fragment that I can't seem to solve.
All help, suggestions are appreciated.
Thanks!
Dave

What I want to do is to check for either if the username or password is good:

The $pwfile contains (exactly like it is here):
username1|password1
username2|password2
ect.....


# stuff $pwd in to @indata
open(FILE,$pwfile) || die &dead("Can't find $pwfile. $!");
@indata = <FILE>;
close(FILE);


# populate a hash , I am guessing here!
foreach (@indata){
($x,$y) = split(/\|/,$_);
$users{$x} = $y;
}


# loop and process each record from $pwd
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);


## want to check here and if something is not matching call our sub &dead
while (($test_username,$test_password) = each %users) {
# print "$test_username,$test_password\n";
# print "$in{'name'} $in{'pwd'} \n";
#&dead("Bad username , Sorry") if ($in{'name'} ne $test_username);
#&dead("Password, Sorry") if ($in{'pwd'} ne $test_password);
} 


---more deleted----

*====================================================*
*   Cora Connection Your West African Music Source   *  
*   http://www.coraconnection.com/                   *  
*   Resources, Recordings, Instruments & More!       *
*====================================================*

Reply via email to