== is a numerical operator
eq is a string operator
"something" == "notsomething" looks at the numerical value of each string,
and they are the same so it returns true.
"something" eq "notsomething" looks at the actual strings, which are
different and returns false.
for more information:
perldoc perlop
/\/\ark
-----Original Message-----
From: Chris Knipe [mailto:[EMAIL PROTECTED]]On Behalf Of Chris Knipe
Sent: Wednesday, July 10, 2002 1:08 PM
To: [EMAIL PROTECTED]
Subject: Am I being stupid here... or?
Lo all,
Very stupid it must be, but I can't see what I'm doing wrong here...
The following if statement, always returns true (prints "a"), regardless
of what the value of $SiteType is...
#!/usr/bin/perl
$SiteType = "something";
if ($SiteType == "notsomething") {
print "a";
}
Am I doing something really arbly stupid here, did I miss anything?
What I'd like to accomplish, is something in the lines of:
if ($SiteType == "PHP3") {
do some stuff
} elsif ($SiteType == "PHP4") {
do different stuff
} elsif ($SiteType == "ASP") {
do different stuff
.....
} else {
do default stuff
}
--
me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]