- You have a stray closing brace after shift(@urlstoget).
- 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.
- Global symbol "$n" requires explicit package name
- 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?