#!/usr/bin/perl use Net::FTP; my $wingate = "www.wingate.com"; my $file = shift; $/ = "\n"; open (DB,"<" . $file) || die ("Could not open file: $!"); while ($line = ) { chomp($line); $address = $line; $username = "anonymous\@$address"; $password = "anonymous\@example.org"; print STDERR "Trying $address...\n"; $FAILED = 0; if ($ftp = Net::FTP->new($wingate, Timeout => 15)) { if ($ftp->login($username,$password)) { print "$address\n"; print STDERR "Logged into $address\n"; } else { print STDERR "Cant login to $address\n"; } $ftp->quit(); } else { print STDERR "Cant connect to $address\n"; } }