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";
> }
>

Nothing stupid, just a mistake like everyone makes sometimes.

Believe you want something like

if ($SiteType eq "notsomething") {
        print "a";
}

"eq" gives a string comparison, "==" is numeric... also, you might 
consider turning on strict and warnings.

-Tommy

-- 
Thomas S. Dixon
Applications Analyst II
Pediatric Cardiology
Medical University of South Carolina



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to