Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Creating files within a .zip

by pmqs (Friar)
on Sep 28, 2012 at 15:41 UTC ( [id://996245]=note: print w/replies, xml ) Need Help??


in reply to Creating files within a .zip

Try this.
use strict; use warnings; use IO::Compress::Zip qw(:all); { my $zip = new IO::Compress::Zip "/tmp/my.zip", Name => "foo/bar.txt" or die "Cannot create zip file : $ZipError\n" ; print $zip "hello world" ; } # Check the zip file was created system "unzip -l /tmp/my.zip" ;
Here is what I get this when I run that code.
Archive: /tmp/my.zip Length Date Time Name --------- ---------- ----- ---- 11 09-28-2012 16:44 foo/bar.txt --------- ------- 11 1 file

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://996245]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found