Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8012405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:19:19+00:00 2026-06-04T19:19:19+00:00

I have a small perl script that I use to search archives for members

  • 0

I have a small perl script that I use to search archives for members matching a name. I’d like to enhance this so that if it finds any members in the archive that are also archives (zip, jar, etc) it will then recursively scan those, looking for the original desired pattern.

I’ve looked through the “Archive::Zip” documentation, and I thought I saw how to do this. I noticed the “fh()” and “readFromFileHandle()” methods. However, in my testing, it appears that the “fh()” call on an archive member returns the file handle for the containing archive, not the member. Perhaps I’m doing it wrong, but I would appreciate an example of how to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:19:21+00:00Added an answer on June 4, 2026 at 7:19 pm

    You can’t read the contents of any sort of archive member (whether it is text, picture, or another archive) without extracting it from the archive file.

    Once you have identified a member that you want to view, you must call extractMember (or, more likely, extractMemberWithoutPaths if the file is to be temporary) to extract it to a disk file. Then you can create a new Archive::Zip object and read the new file while keeping the old one open.

    You will presumably want to unlink the archive file once you have catalogued its contents.


    Edit

    I hadn’t come across the Archive::Zip::MemberRead module before. It appears you were on the right track with readFromFileHandle. I would guess that it should work like this, but it would be awkward for me to test it at present.

    my $zip = Archive::Zip->new;
    $zip->read('myfile.zip');
    
    my $zipfh  = Archive::Zip::MemberRead->new($zip, 'archive/path/to/member.zip');
    
    my $newzip = Archive::Zip->new;
    $newzip->readFromFileHandle($zipfh)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may be a basic question. I have written a small perl script to
I have written a small Perl script and now I would like to create
I am generating new xml file using perl script but I have small problem,
I have a small perl script ( found here ) which adds command line
I have a small awk script that does some in-place file modifications (to a
I'm using Perl's XML::XPath package in a small script. I'm pretty sure I have
I want to make a small GUI using Tk in Perl that will have
I have a Perl script that crunches a lot of data. There are a
I have written a small script in Perl which I am executing on Windows
I have small script in bash, which is generating graphs via gnuplot. Everything works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.