I wrote a Perl program where the user should type in a user name. If they enter admin, they should see the message
Welcome, admin!
Otherwise the console output should be
The username is incorrect
Here is my code
use utf8;
print "Username: ";
$username = <STDIN>;
if ( $username eq "admin" ) {
print "Welcome, admin!";
}
else {
print "The username is incorrect.";
}
But whatever the user inputs the program goes on to the else branch.
Why does this happen?