Dear All, I am new to Perl. My code below seems to work only on the else statement even when the if evaluate to true:
if (grep /($FORM{user}|$FORM{pin})/i, "/export/install/users.txt") { `/export/install/sysmo.sh > /export/install/log.txt`; print "Content-type:text/html\r\n\r\n"; print "<html>"; print "<head>"; print "<title>Account/title>"; print "</head>"; print "<body>"; print "<h2>Hello $user, your account - ready</h2>"; print "</body>"; print "</html>"; exit(0); } else { print "Content-type:text/html\r\n\r\n"; print "<html>"; print "<head>"; print "<title>Account /title>"; print "</head>"; print "<body>"; print "<h2>Your user/pin incorrect - Use correct input</h2>"; print "</body>"; print "</html>"; }
In reply to perl if statement by Drsin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |