If you still want to write it yourself, do not use threads at all, use IO::Select, Event, or EV.
In reply to Re: Multithreaded Port Scanner by zwon in thread Multithreaded Port Scanner by marto9