[英]How can I use Net::FTP to get a file matching a pattern?
Try this solution from perlmonks.org. 从perlmonks.org尝试此解决方案 。 Essentially do a remote ls, filter out what you don't want with grep
, then fetch the files. 本质上是执行远程ls,使用grep
过滤掉不需要的内容,然后获取文件。
$ftp->get($_) for grep /\.txt$/, $ftp->ls;
BTW, this took about 10 seconds to find with Google "net::FTP mget" 顺便说一句,这用了大约10秒钟的时间才能通过Google找到“ net :: FTP mget”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.