2016-02-10 1 views
0

В Perl У меня есть ниже линииPerl отключить Archive :: Extract Эрро 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

Вы должны прочитать документацию Archive :: Extract перед отправкой вопроса. – neuhaus

ответ

0

$Archive::Extract::WARN to 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.