Q:
Could you please tell me what is wrong with my script. Its only 10-lines.
It seems right but it keeps coming up with my error messsage "wrong
username and password" even when i put it in right.
I posted the code on the internet. The url is
http://gameswap.home7.dk3.com/gameswap/test00333.html
after the @up= is <USERPASS> but it wouldnt show up. Please help me
A:
When you read the two lines containing the user name and the password you
actually read two lines altogether including the line terminating new-line
characters.
The comparison operator sees that the typed username does not match the
one in the variable, because the variable also contain a new-line
character at the end. Thus your program does not accept the
username/password.
To correct this you have to write
chomp @up;
just after having read it from file.
Regards,
Peter
[ back to toc ]