after which you can continue:use IO::Uncompress::Unzip qw(unzip $UnzipError); my $file = '2.zip'; my $inner; unzip $file, \$inner, Name => '1.zip';
and now the text will be in the string $txt. (Caveat: untested)my $txt; unzip \$inner, \$txt, Name => '1.txt';
Apparently the "Name => $name" part is optional if the ZIP archive contains only one file (what they call a "member file"):
Say you have a zip file, file1.zip, that only contains a single member, you can read it and write the uncompressed data to the file file1.txt like this.unzip $input => $output or die "unzip failed: $UnzipError\n";If you have a zip file that contains multiple members and want to read a specific member from the file, say "data1", use the Name option
unzip $input => $output, Name => "data1" or die "unzip failed: $UnzipError\n";
In reply to Re^3: Reading a .txt file under 2 levels of compression
by bart
in thread Reading a .txt file under 2 levels of compression
by LazyIntern
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |