我目前正在使用带有 Net::FTPSSL::Robust 的 TLS 加密遍历一堆服务器的目录。我想下载文件,然后在下载时删除它们。我不想删除文件夹名称。
问题是,Robust 只有一个 get() 并且它不会删除它需要的文件。我知道必须有办法做到这一点。正如您在此处看到的,删除将不起作用,因为它不是 Net::FTPSSL::Robust 的一部分,尽管它是 Net::FTPSSL 的一部分:
my $ftp = Net::FTPSSL::Robust->new
( Host => $server->{'ip_address'}->{content}
, Port => $port
, SECURITY_TLS => $encryption
, user => $server->{'username'}->{content}
, password => $server->{'password'}->{content}
, login_attempts => 3
);
$local_dir = $server->{'local_directory'}->{content} if($server->{'local_directory'}->{content});
# when needed, many attempts will be made to retrieve all
$ftp->get("/", "".$local_dir);
$ftp->delete("/")
任何人都可以对此有所了解或有更好的解决方案吗?我对 Perl 完全陌生,所以在此先感谢。