I'd use uncompressedSize:

#!/usr/bin/perl use strict; use Archive::Zip; foreach my $zipfnm (@ARGV) { if (-e $zipfnm) { # ZIP file exists. Proceed. my $zipobj = Archive::Zip->new($zipfnm); # ZIP obje +ct pointer my @mbrhan = $zipobj->members(); foreach my $mbrhan (@mbrhan) { # Next member found in ZIP file my $mbrfnm = $mbrhan->fileName(); my $mbrfsz = $mbrhan->uncompressedSize(); print "$mbrfnm is $mbrfsz bytes\n"; } } } exit; __END__

D:\PerlMonks>7z l -tzip test.zip 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Listing archive: test.zip -- Path = test.zip Type = zip Physical Size = 330 Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ----------------- +------- 2015-03-10 15:40:58 ....A 22 22 test.dat 2015-03-10 15:41:09 ....A 28 28 test2.dat ------------------- ----- ------------ ------------ ----------------- +------- 50 50 2 files, 0 folder +s D:\PerlMonks>zipgetsize.pl test.zip test.dat is 22 bytes test2.dat is 28 bytes D:\PerlMonks>


In reply to Re: Unzip -l replacement by marinersk
in thread Unzip -l replacement by sirhalos

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.