J
Jay Sun Ex
I searched thru the posts for something on ne and didn't come across
anything that could explain what my script is not doing. I am just
doing a simple test. If I change the "ne" to "eq" and run the program
with the same inputs it works fine, change them back to "ne" and it
doesn't work. The source is below. I am hoping it is something
insanely complicated so that I don't feel retarded. It should also be
mentioned that if I take out the || and the second inequality, ne does
what it is supposed to. I also tried substituting "or" for "||" and
have the same results. Thanks.
#!/usr/local/bin/perl -w
print "\nPlease enter your name: ";
chomp ($name = <STDIN>);
if ($name ne "me" || $name ne "myself") {
die "\nYou're not allowed here $name. Bye!\n";
} else {
print "\nWelcome $name\n";
}
anything that could explain what my script is not doing. I am just
doing a simple test. If I change the "ne" to "eq" and run the program
with the same inputs it works fine, change them back to "ne" and it
doesn't work. The source is below. I am hoping it is something
insanely complicated so that I don't feel retarded. It should also be
mentioned that if I take out the || and the second inequality, ne does
what it is supposed to. I also tried substituting "or" for "||" and
have the same results. Thanks.
#!/usr/local/bin/perl -w
print "\nPlease enter your name: ";
chomp ($name = <STDIN>);
if ($name ne "me" || $name ne "myself") {
die "\nYou're not allowed here $name. Bye!\n";
} else {
print "\nWelcome $name\n";
}