David, Thank you for your help but I think I am not explaining myself correctly.
I am writing to four separate .txt files file where the array [2] is assigned to the variable "$partition" If $partition eq "Public" only write to a file called $public_text If $partition eq "Public" or $partition eq "OPSEC SDK" then write to a file called $opsec_text If $partition eq "GOLD" or $partition eq "Public" or $partition eq "OPSEC SDK" then write to a file called "advanced" If $partition eq "CSP" or If $partition eq "GOLD" or $partition eq "Public" or $partition eq "OPSEC SDK" then write to a file called "CSP" Does that make sense? Thank you in advance Lance -----Original Message----- From: david [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 12:33 PM To: [EMAIL PROTECTED] Subject: Re: "Or" Syntax Lance Prais wrote: > If I wanted to say: > > If a=b or a=c r 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] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]