in reply to Without Unzipping and without using Archive module Can we read the file in zip file

As VinsWorldcom already said, Yes, even you can use CPAN.

But luckily, IO::Uncompress::Unzip is a core module:

use warnings; use strict; use IO::Uncompress::Unzip (); my $filename = 'foo.zip'; my $membername = 'bar.txt'; my $z = IO::Uncompress::Unzip->new($filename, Name=>$membername) or die "unzip failed: $IO::Uncompress::Unzip::UnzipError\n"; while (my $line = <$z>) { # do something with each $line } $z->close;
  • Comment on Re: Without Unzipping and without using Archive module Can we read the file in zip file
  • Download Code

Replies are listed 'Best First'.
Re^2: Without Unzipping and without using Archive module Can we read the file in zip file
by Anonymous Monk on Mar 01, 2018 at 14:18 UTC
    A key thing to point out about that module is that it is unzipping and providing the data from the archive on the fly. So, if what you mean by "without unzipping it" is that you don't want to spend the time or the disk-space decompressing the entire archive, this core module probably does satisfy your requirement. (The perldoc clearly shows how the file-glob reference is equivalent to "getline().")