#!/usr/bin/perl use IO::Socket; my $dir = $ARGV[0]; my @ports = qw(8080 1080 31337 6588 3128 81); my $i = 0; my $time = time; open(READ,"<".$dir.""); while() { chomp($_); $i++; print "".$i." · ".$_."\n"; foreach my $port (@ports) { my $is_proxy = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $_, PeerPort => $port, Timeout => 1, ) or next; print "".$i." · ".$_." (".$port.")\n"; $is_proxy->close; last; } } close(READ); my $time_ = time - $time; print "IPs: ".$i." · Time: ".$time_."\n"; exit();