Lance Prais wrote:
> If I wanted to say:
>
> If a=b or a=c or a=d do this How would I do that?
don't use '=' for comparison, sue '==' for numeric comparison and 'eq' for
string
>
> I thought I could do it like this but it did not work.
>
> 1.
> If ($a=b) || ($a=c) || ($a=d)
> {
> DO this
> }
the above is syntax error. should have been:
if($a eq 'b' || $a eq 'c' || $a eq 'd'){
}
>
> 2.
> If ($a=b) || if ($a=c) || if ($a=d)
> {
> DO this
> }
the above is also syntax error
i notice that in your code, you sometimes have:
if($a eq 'Public'){
$b = 1;
}
if($a eq 'Public' || $a eq 'Whatever'){
$b = 2;
}
if($a eq 'Public' || $a eq 'Whatever' || $a eq 'Something'){
$b = 3;
}
now if $a is 'Public', all three of the if statement is true and the last if
statement sets $b equal to 3 which overwrites whatever is set in the first
2 if statement. i am not sure if that's really what you want or do you
mean:
if($a eq 'Public'){
}elsif($a eq 'Whatever'){
}elsif($a eq 'Something'){
}else{
}
david
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]