You're using a numerical comparison operator (==) when you should be
using a lexigraphical comparison operator (eq). So your line should read
if($SiteType eq "notsomething") {
print "a";
}
On Wednesday, July 10, 2002, at 04:07 PM, Chris Knipe wrote:
> 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]
>
>
>
// George Schlossnagle
// Principal Consultant
// OmniTI, Inc http://www.omniti.com
// (c) 240.460.5234 (e) [EMAIL PROTECTED]
// 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]