Hopefully someone more familiar with perl dB calls will be able to help with this.
If I were trying to debug it, I would: * put a print statement after the line where you assign to the $date variable and before the first if statement, so that you know that all of the records are being seen. * make sure that all of my open statements were working using || die. * make sure that I'm looking in the right file for everything. * possibly print more to the screen while I'm debugging it. I hope these suggestions help some. /\/\ark -----Original Message----- From: Lance Prais [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 5:39 PM To: James Edward Gray II Cc: Perl Subject: RE: "Or" Syntax Please let me know if you have any questions' # get solutions Id that are Alerts my $alert = $dbh->prepare(q{SELECT nvl((a.pc_solution_id),0), a.pc_title, d.pc_enum_value, b.pc_date_created FROM pt_solution a, pt_solution_prop b, pt_prop_enum_values c, pt_prop_enum_values d, pt_prop_enum_values e WHERE c.pc_enum_value = 'Yes' and e.pc_enum_value = 'Approved' and b.pc_status = 233 and b.pc_status = e.pc_enum_id and a.pc_secure_id = b.pc$sol_secure_id and b.pc_alert = c.pc_enum_id and b.pc_partition = d.pc_enum_id and b.pc_partition = d.pc_enum_id}); $alert->execute(); #print "-----> result_path: $result_path\n"; while( my @row = $alert->fetchrow_array ) { my $oid=$row[0]; my $title=$row[1]; my $partition=$row[2]; my $date=$row[3]; if ($partition eq "Public"){ open(PUBLIC_ALERTSFILE,">$public_alerts_index_txt_filename"); print PUBLIC_ALERTSFILE"$oid". "::" ."$title". "::" ..."$partition". "::" ."$date\n"; close(PUBLIC_ALERTSFILE) || die "can't close $file: $!"; } if ($partition eq "Public" || $partition eq "OPSEC SDK"){ open(OPSEC_ALERTSFILE,">$opsec_alerts_index_txt_filename"); print OPSEC_ALERTSFILE"$oid". "::" ."$title". "::" ..."$partition". "::" ."$date\n"; close(OPSEC_ALERTSFILE) || die "can't close $file: $!"; } if ($partition eq "Gold/Platinum"|| $partition eq "Public" || $partition eq "OPSEC SDK"){ open(ADVANCED_ALERTSFILE,">$advanced_alerts_index_txt_filename"); print ADVANCED_ALERTSFILE"$oid". "::" ."$title". "::" ..."$partition". "::" ."$date\n"; close(ADVANCED_ALERTSFILE) || die "can't close $file: $!"; } if (($partition eq "CSP") ||($partition eq "Gold/Platinum") || ($partition eq "Public") || ($partition eq "OPSEC SDK")){ open(CSP_ALERTSFILE,">$csp_alerts_index_txt_filename"); print CSP_ALERTSFILE"$oid". "::" ."$title". "::" ..."$partition". "::" ."$date\n"; close(CSP_ALERTSFILE) || die "can't close $file: $!"; } # print "-----> Solution: $oid". "::" ."$title". "::" ."$partition". "::" ..."$date\n"; } # # $alert->finish(); -----Original Message----- From: James Edward Gray II [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 7:36 PM To: Lance Prais Cc: Perl Subject: Re: "Or" Syntax 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] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]