我需要允许用户通过网络表单上传 zip 文件。该服务器使用 Apache Web 服务器运行 Linux。使用像 Archive::Zip 这样的模块有什么好处吗?提取这个文件还是应该执行一个系统调用到 unzip
带反引号?
最佳答案
根据Archive::Zip documentation你最好使用Archive::Extract :
If you are just going to be extracting zips (and/or other archives) you are recommended to look at using Archive::Extract instead, as it is much easier to use and factors out archive-specific functionality.
这很有趣,因为 Archive::Extract will try Archive::Zip first and then fall back to the
unzip
binary if it fails.因此,Archive::Zip 似乎是首选选项。存档::Zip 使用 Compress::Raw::Zlib这是 zlib 系统库的低级接口(interface);所以它不是一个纯粹的 Perl 实现,这意味着它的性能将类似于
unzip
.因此,换句话说,从性能的角度来看,没有理由选择 unzip
。在存档::Zip 之前。
关于perl - 如何在 Perl 中提取压缩文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1668694/