Archive::Zip wasn't adding any files because you didn't give it any. 22 bytes is the size of an empty zip file.

Here's demo code: create empty file and see that it's 22 bytes.

use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); my $zip = Archive::Zip->new(); unless ( $zip->writeToFileNamed("someZip1.zip") == AZ_OK ) { die "write error: $!"; }
Same code, but add one file named "perl150.pl".
use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); my $zip = Archive::Zip->new(); my $file_member = $zip->addFile( "perl150.pl" ); unless ( $zip->writeToFileNamed("someZip2.zip") == AZ_OK ) { die "write error: $!"; }

And the output files:

$ ls -l someZip* -rw-r--r-- 1 gmargo gmargo 22 Oct 28 10:39 someZip1.zip -rw-r--r-- 1 gmargo gmargo 335 Oct 28 10:34 someZip2.zip $ unzip -v someZip1.zip Archive: someZip1.zip warning [someZip1.zip]: zipfile is empty $ unzip -v someZip2.zip Archive: someZip2.zip Length Method Size Ratio Date Time CRC-32 Name -------- ------ ------- ----- ---- ---- ------ ---- 282 Defl:N 217 23% 10-28-09 10:34 ade4be0c perl150.pl -------- ------- --- ------- 282 217 23% 1 file


In reply to Re: archive:zip and jaunty ubuntu by gmargo
in thread archive:zip and jaunty ubuntu by LineAxe

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.