#!/usr/bin/perl use strict; use Archive::Zip; use Archive::Zip::MemberRead; my ($zipfnm, $mbrfnm, @arglst) = @ARGV; { if (-e $zipfnm) { # ZIP file exists. Proceed. my $zipobj = Archive::Zip->new($zipfnm); # ZIP object pointer # Adjust Windows specifications my $mbranm = $mbrfnm; $mbranm =~ s/\\/\//g; # Proceed. my $mbrhan = Archive::Zip::MemberRead->new($zipobj, $mbranm); # Synopsis does not specify error handling return; # Left as an exercise for the reader :-) # OP indicates reading lines from the file, so use the text file technique while (defined(my $inpbuf = $mbrhan->getline())) { # Note the line read is already chopped or chomped (!!) print "Line " . $mbrhan->input_line_number . ": [$inpbuf]\n"; } } } exit; __END__