my $mech = WWW::Mechanize->new(); $mech->submit_form( with_fields => { login => "your_login", password => "your_password", }, ); my @threads = map { threads->create( \&create_thread, $_ ) } ( 1 .. $config->{number_of_threads} );