Subject: | Give early notice on non-zip files |
I download zip files, but every once in a while, they're really just
text files. It would be nice if it died on:
my $z = IO::Uncompress::Unzip->new($zip_file)
or die "Feiled to open $zip_file: $UnzipError";
Instead it dies at:
my $filename = $z->getHeaderInfo()->{Name};
because getHeaderInfo returns undef.
Also, if I eval and ignore that error, then:
my $status = $z->nextStream()
dies with "Can't call method "reset" on an undefined value at
.../IO/Uncompress/Base.pm line 958.