in reply to fork/threads: running after childrem

  1. You have a stray closing brace after shift(@urlstoget).
  2. You use Proc::Queue, but I don't have that, so I commented it out. Maybe that's the problem. It appears to do about what Parallel::ForkManager does, so maybe using that would help.
  3. Global symbol "$n" requires explicit package name
  4. There's no semicolon between the call to processresponse() and exit.

After I fixed each of those (and commented out the actual fetching and connecting to the db), it did just what I expected. Could you provide a running example that shows the problem?