sub ftp_sdat { my $path = "pub/antivirus/datfiles/4.x/"; use constant HOST => 'ftp.nai.com'; use constant DIR => 'pub\antivirus\datfiles\4.x'; my $depost = "D:\\Depot\\McAfee\\updateNT\\"; my $ftp = Net::FTP->new(HOST) or die "Couln't connect: $@\n"; $ftp ->login("anonymous",'user@domain.com') or die $ftp->message; $ftp->binary or die $ftp->message; # # Since the Mget command is missing. We get a ls listing and then # look for the current SDAT file. my @dirlist = $ftp->ls("$path") or die $ftp->message; foreach my $file (@dirlist) { if ($file =~ /sdat/) { print "dat $file\n"; $ftp->get("$file") or die $ftp->message; } } $ftp->quit; return $file; }