Hello,
I'm a bit stuck with Archive::Zip. I'm trying to find a clean way to
append to a file inside a Archive::Zip object. See the code below:
my $zip = Archive::Zip->new();
for my $master(@{$json}) {
$config = qx /some command depending on $master/;
$zip->addString($config, 'test', COMPRESSION_DEFLATED);
}
...
die 'write error' if ($zip->writeToFileNamed('test.zip') != AZ_OK);
This code creates a zip file which contains several files, all named
'test'. The thing I'm trying to achieve is to have all the output of
commands being appended to a 'test' file, into the zip.
How can I do this properly ? I mean without having to create a temp file
with a filehandle with all the output and adding the file to the zip
after the for loop.
Any help would be appreciated.
Thanks
--
Vincent Lequertier
skysymbol.github.io
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/