in reply to Re: working with foreach, nestd if's inside
in thread working with foreach, nestd if's inside
--------foreach $line (@user) { chomp($line); ($name, $site, $site_id, $des, $email, $pass) = split(/\|/,$ +line); $pass2 = crypt($q->param('pass'), r); if($q->param('user') eq $site_id) { if($pass2 eq $pass) { &start; } else { &error("Password Incorrect"); } } else { &error("Username does not exist"); last;} } }
I tried last and it prints once, but it alwats says Username does not exist, I can't get around it.else { &error("Username does not exist"); last;}
|
|---|