my @threads : shared; for ($start .. $end) { $agent->follow_link(text => "Next") or last; $threads[$_] = threads->new(\&action, $agent->content(), $_); }