in reply to loop criteria not accessable in loop??

i cut and paste, and wrap it a little bit with some variable definitions to make it work, and it works just fine... nothing wrong with the code or the scope handling of $sc_id... -- bliz
  • Comment on Re: loop criteria not accessable in loop??

Replies are listed 'Best First'.
RE: Re: loop criteria not accessable in loop??
by mrmick (Curate) on Aug 16, 2000 at 21:49 UTC
    Now that you have described what you did, could you post your solution for everyone to see? It would probably be nice for jptxs to see what works for you. :-)

    Mick
      the only thing I did was assign values to all those date vars and such that he accesses, and values into the associative array.. no actual changes to his code... I was just saying that his code works.. but sure... I mean.. if it helps.. whatever.. :)
      $sc{1}="bob"; $sc{'eatit200'}="jane"; $sc{'testCINDY'}="cindy"; ($SMONTH,$SDAY,$SYEAR,$SHOUR,$SMINUTE,$EDAY,$EYEAR,$EHOUR,$EMINUTE)=(1 +,2,3,4,5,6,7,8,9); foreach my $sc_id (keys %sc) { # Oracle wil not let me put in that '0' at the start; all call_id's +will start with '7' my $call_id = sprintf "7%02d%02d%02d%02d%02d%07d%02d%02d%02d%02d%02d +",$SMONTH,$SDAY,$SYEAR,$SHOUR,$SMINUTE,$sc_id,$EDA my $status = "scheduling"; my $temp_record_statement = qq! INSERT INTO SC_APPT (CONTACT, CALL_ID, SC_ID, CONT_PHN, AP_START, AP_END, STATUS, COMPAN +Y, TRANS_ID, APPT_TYPE, REP_EMAIL, ADD_ST, ADD_STATE, ADD_CITY, ADD_ZIP +) VALUES ('system_reserve', $call_id, $sc_id, 8003069329, '$start_time', '$en +d_time', '$status', 'Quest Software', $trans_id, 'Internal', 'Joanna', 'placeholder', 'NJ', 'Montclair', 9 +99999999) !; print $temp_record_statement, "\n"; print $sc_id, "\n"; #$dbh->do("$temp_record_statement") || dienice("320 Couldn't execute + statement: $temp_record_statement $sc_id" . $sth- }
      I hope that helps... like I said.. I didn't really change anything.. it just worked to start with.. I was just pointing out that his problem was something different that what he was describing... -- bliz
      Well, what he's saying is that he could not reproduce jptxs's problem because the code that was originally published does work if you include enough to make it even make sense!

      See the part that's broken is the part that jptxs didn't tell us about. That's a common help-desk nightmare. I understand how people fall into that trap: it's a complex system, and they don't know what's broken, so they throw random parts of it at experts and say "is this broken?". As we kept saying, no, this part is not broken. That's life.

      -- Randal L. Schwartz, Perl hacker