in reply to loop criteria not accessable in loop??

It looks to me like it should accessible. What evidence do you have that it isn't?

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: loop criteria not accessable in loop??

Replies are listed 'Best First'.
RE: Re: loop criteria not accessable in loop??
by jptxs (Curate) on Aug 16, 2000 at 20:26 UTC
    the SQL statement generated during the loop uses the value $sc_id from the loop definition and bombs out because it is undefined. that's what showed me at first, then i looked at everything else that was going on in there and realized it was undefined the whole time. i placed prints throughout the lop and it seems to be undefined the whole time.
      Do you mean "undefined", or undef? It can't be undef if you are walking through the keys of a hash. What value does it have at the top of the loop?

      -- Randal L. Schwartz, Perl hacker

        i meant "undefined" in the sense that it's simply retuning blank when printed or called in any way.

        the value it (should) have is a number which it gets from the results of another SQL query. I've done multiple tries with the query in and out of the program, placed prints and such, and it returns just fine. i can place prints in just before the definition of the hash for the arrays that make it up and they come out fine.