Need help with perl loop!
Hello.
I have name/pass .txt file like this:
name1|ftftft
name2|sesese
I would like this file to be compared to the $FORM{'name'} and $FORM{'password'} values and upon the match, deciee what to do. However things are not working.
Here is my code:
####
sub pass {
$cryptpass = crypt($FORM{'password'}, "ts");
open(FILE,"$pass_file");
@lines = <FILE>;
close(FILE);
for ($lines_no = 0; $lines_no <= $#lines; $lines_no++) {
chomp($lines[$lines_no]);
($name, $password) = split(/\|/, $lines[$lines_no]);
if ($FORM{'name'} =~ $name) || (crypt($FORM{'password'}, "ts") =~ $password)
{
&intro;
}
else {
&badlogin;
}
}
exit;
}
########
|