htmanning has asked for the wisdom of the Perl Monks concerning the following question:
I can't figure out why it doesn't go through. I've even changed the IF statement and it doesn't work either. I'm stumped.@jobvar_list=(); @jobname_list=(); @jobnice_list=(); $n = 0; @jobvar_list[$n] = "senior"; @jobname_list[$n] = " Senior"; $n++; @jobvar_list[$n] = "exec"; @jobname_list[$n] = " Executive"; $n++; $quick_build="listing"; $quick_jobtype="exec"; print "job types...<br>\n"; #(THIS GETS PRINTED) for ($st=0; $st<=@jobvar_list-1; $st++) { $temp_jobvar = @jobvar_list[$st]; print "$temp_jobvar, $quick_jobtype...<br>\n"; #( THESE GET PRINTE +D AS THE LOOP GOES THROUGH) if (($quick_jobtype && ($quick_jobtype eq $temp_jobvar)) || (!$qui +ck_jobtype)) { #if ($quick_jobtype eq $temp_jobvar) { #ALTERNATE IF STATEMENT THAT + ALSO DOESN'T WORK $jobvar = $temp_jobvar; $jobname = @jobname_list[$st]; $groupfile = $jobvar; $grouptitle = $jobname; $sortby = " WHERE jobtype like '%$jobvar%' and active='yes' AND jo +bstatus!='suspend' ORDER BY dateadded DESC, jobtitle ASC"; print "$sortby"; #(THIS DOES NOT GET PRINTED) print "starting build lists<br>\n"; #(THIS DOES NOT GET PRINTED) $building_cat = "yes"; &Build_Lists_Both; } # end if ($cat1 eq $cat_db_var) } # end for ($st=1; $st<=$jobvar_list; $st++)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help with a loop
by Preceptor (Deacon) on Jun 14, 2013 at 21:34 UTC | |
by htmanning (Friar) on Jun 14, 2013 at 21:44 UTC | |
by Preceptor (Deacon) on Jun 15, 2013 at 12:47 UTC | |
|
Re: Help with a loop
by space_monk (Chaplain) on Jun 14, 2013 at 21:22 UTC | |
|
Re: Help with a loop
by frozenwithjoy (Priest) on Jun 14, 2013 at 21:25 UTC |