Could you post the important part of your code, please? James
On Thursday, September 26, 2002, at 07:26 PM, Lance Prais wrote: > Hello and thanks for your help. It still does not seem to be working > as I > expect maybe I am assuming I am not explaining myself correctly. Let > me > try one more time and see if what happens. > > I am reading this file and have assigned the array[2] as $partition. > > sk5719::Is Automatic ARP supported on Linux > platforms?::Public::03-JUL-01 > sk14508::The last date to order VPN-1/FireWall-1 CP2000 is December > 31,2002.::Public::23-SEP-02 > skI4680::Which files to backup in order to restore the NG Management > Server::Gold/Platinum::05-OCT-01 > > My if statement is as follows: > if (($partition eq "CSP") ||($partition eq "Gold/Platinum") || > ($partition > eq "Public") || ($partition eq "OPSEC SDK")) > { > Do something > } > > The assumption is that I will get all the rows from the .txt file but > it is > only getting the "Gold/Platinum" I believe this is because it is the > last > item in the list." > > > Any Ideas? > > Thank you in advance > Lance > > -----Original Message----- > From: Mark Anderson [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 26, 2002 7:04 PM > To: Lance Prais; Perl > Subject: RE: "Or" Syntax > > If you are comparing numbers, you want to use == (strings use eq). > > You probably also only want to have one set of parens: > if ($a == $b || $a == $c || $a == $d) {print "here"} > or you could clarify further: > if (($a == $b) || ($a == $c) || ($a == $d)) {print "here"} > > You should put the following lines at the top of your perl scripts, > they > would likely have helped you solve some of this on your own: > use strict; > use warnings; > > -----Original Message----- > From: Lance Prais [mailto:[EMAIL PROTECTED]] > Sent: Thursday, September 26, 2002 4:56 PM > To: Perl > Subject: "Or" Syntax > > > If I wanted to say: > > If a=b or a=c or a=d do this How would I do that? > > I thought I could do it like this but it did not work. > > 1. > If ($a=b) || ($a=c) || ($a=d) > { > DO this > } > > 2. > If ($a=b) || if ($a=c) || if ($a=d) > { > DO this > } > > Could someone tell help me with this? > > > Thanks in advance > Lance > > > -- > 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] > > > -- > 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]