Unable to close datastream at script.pl line 92
####
$ftpmsg = $ftp->get($listing{$x}[$y][0],"/$path1/$path2/$x/$listing{$x}[$y][0]");
####
…
$ftp = Net::FTP->new("ftp.nai.com", Debug => 0) or die "Cannot connect to ftp.nai.com: $@\n";
$ftp->login("anonymous","user\@domain.com") or die "Cannot login to ftp.nai.com: " . $ftp->message . "\n";
$ftp->binary() or die "Cannot change to binary data format: ". $ftp->message() . "\n";
…
$counter = 0;
do
{
$counter++;
$ftpmsg = $ftp->get($listing{$x}[$y][0],"/$path1/$path2/$x/$listing{$x}[$y][0]");
} until ($ftpmsg eq "/$path1/$path2/$x/$listing{$x}[$y][0]" || $counter >= 10);
…
####
unless ($data->close()) # implied $ftp->response
{
carp "Unable to close datastream";
return undef;
}