2016-02-10 28 views
0

Perl我有以下線Perl中禁用存檔::提取埃羅rmessages

my $hu_unzip = Archive::Extract->new(archive => $dest_path.'\one.zip'); 
my $ok1 = $hu_unzip->extract(to => $dest_path); 
my $rse_unzip = Archive::Extract->new(archive => $dest_path.'\two.zip'); 
my $ok2 = $rse_unzip->extract(to => $dest_path); 

但是,當我運行得到下面的消息我卻依然unzip情況正常。

format error: bad signature: 0x00000a00 at offset -1 in file E:\Folder\New\one.zip Archive::Zip::_readSignature('IO::File=GLOB(0x23f9644)'

這裏我不想讓這個error被打印。 那麼我應該怎麼做

+0

你應該已經張貼在提問前閱讀存檔::提取的文檔。 – neuhaus

回答

0

設置$Archive::Extract::WARN爲false。

的文檔狀態:

This variable controls whether errors encountered internally by Archive::Extract should be carp'd or not. Set to false to silence warnings. Inspect the output of the error() method manually to see what went wrong.