I'm trying to do something which I'm sure is pretty simple, using Archive::Zip.

When you install a new FireFox, it has the default size of the history menu set to ten, which I like to change to something like 30 or 40.

To do this I grab a file called "browser.jar", unzip it, open "content/browser/browser.js" from the resulting folder, edit it, put it back, and zip it up again.

I spent about an hour last night trying to automate that with perl and Archive::Zip and gave up in frustration.

I guess maybe I don't understand Zip files? Should I be trying to extract a "member" file from "browser.jar"? Or using extractTree() because the file has a zipped directory structure? I don't understand the point of the "root" option in extractTree(), and when I try to extract the file 'content/browser/browser.js' directly from the Zip file, I get an error.

Here's what I want in pseudocode:

open '/path/to/browser.jar'; extract '/path/to/one/file/browser.js'; ## edit the file -- this bit I can do! put back '/path/to/one/file/browser.js'; close '/path/to/browser.jar';


($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print

In reply to Explain Archive::Zip to me please? by Cody Pendant

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.