我正在研究Perl。我需要从网站下载一个.gz文件,然后用Perl对其进行压缩或解压缩。我的代码:
use LWP::Simple;
use XML::Simple qw(:strict);
use Data::Dumper;
use DBI;
use Getopt::Long;
use IO::Uncompress::Gunzip qw($GunzipError);
use IO::File;
my $url = 'http://nvd.nist.gov/feeds/xml/cve/nvdcve-2.0-Modified.xml.gz';
my $file = 'nvdcve-2.0-Modified.xml.gz';
getstore($url, $file);
my $xmlFile = 'nvdcve-2.0-Modified.xml';
gunzip $file => $xmlFile
or die "gunzip failed: $GunzipError\n";我使用解压缩来释放文件。该文件已成功下载并存储在$file中,但持枪邮政编码不起作用。非常感谢你的帮助,谢谢。
发布于 2016-09-28 14:41:52
必须将gunzip函数导入您的命名空间:
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);https://stackoverflow.com/questions/39750536
复制相似问题