i wrote a code and i need to make it multithreaded. Evething works, but every loop repeats 4 times:
use LWP::UserAgent;
use HTTP::Cookies;
use threads;
use threa
Why do you need to make it threaded? perl does much better using forks in most cases.
That said, your code starts 4 threads, each of which processes everything in @groups. It sounds like that's not what you want to do. If you want @groups to be a queue of work to do, take a look at Thread::Queue (or Parallel::ForkManager).