in reply to Zip file problems

I read Archive::Zip but I couldn't find what I was looking. I couldn't use the tip you gave me. the code I use for zipping is:
use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); $namein = "$path\\$name"; $nameout = "$pathout\\AFJPWEB6_$anio$mes$dia\.zip"; print "Comprimiendo ", $namein,"\n"; my $zip = Archive::Zip->new() ; my $member = $zip->addFile( $namein ); my $status = $zip->writeToFileNamed( $nameout ); die "error somewhere" if $status != AZ_OK;

Replies are listed 'Best First'.
Re^2: Zip file problems
by holli (Abbot) on Feb 08, 2005 at 17:38 UTC
    so this zips a single file. if you want to add multiple files to the archive you will have to loop these.
    @names = ("name1", "name2"); $nameout = "$pathout\\AFJPWEB6_$anio$mes$dia\.zip"; print "Comprimiendo ", $namein,"\n"; my $zip = Archive::Zip->new() ; $zip->addFile( $_ ) for @names; my $status = $zip->writeToFileNamed( $nameout ); die "error somewhere" if $status != AZ_OK;
    holli, /regexed monk/
Re^2: Zip file problems
by rev_1318 (Chaplain) on Feb 08, 2005 at 17:42 UTC
    I couldn't use the tip you gave me

    Why not? What is wrong with the example? And what are you looking for, if your (answered) question wasn't the question you wanted to ask?