Код:
#! /usr/bin/perl ###############Чекер FTP (c)0ded by $p01nt use warnings; use Net::FTP; use threads; open(ALL,"all.txt");@all=<ALL>;close(ALL); open(GOOD,">good.txt");open(BAD,">bad.txt"); $np=$#all/2;@one=@all[0..$np];$np++;@two=@all[$np..$#all]; $tred[0]=threads->create(\&chek,@one); $tred[1]=threads->create(\&chek,@two); $tred[0]->join;$tred[1]->join; sub chek { foreach (@_){ $zap=$_; $_=~s/ftp:\/\///ig; ($pair,$host)=split("\@",$_);chomp($host); ($user,$passwd)=split(":",$pair);chomp($user,$passwd); unless ($ftp=Net::FTP->new($host,Debug=>0,Timeout=>5)) { print BAD $zap;} else { if($ftp->login($user,$passwd)){ print GOOD $zap} else { print BAD $zap}} }}