Hi,

I hear PSI::FileContents is popular for doing this. Ahem, sorry.

If you want to list the files in a zip archive perhaps just unzip -l archive.zip will do what you like. That's what man zip tells me at least. I'm sure there are dos/windows equivalents.

If you really need to use Perl to do this check out Archive::Zip It looks like the memberNames method might return a list of the files within the archive.

Something to keep in mind is that somewhere either of these methods has to open() the file - otherwise how would they get any information from it? (I|We) could probably be of more help if you could provide more information about what you want to do.

{NULE}
--
http://www.nule.org


In reply to Re: Reading contents of a zip file without opening it by {NULE}
in thread Reading contents of a zip file without opening it by WintersMystic

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.