in reply to Zipping Files

Check your error logs. I'm quite certain you'll find errors there since you're using strict and not defining variables before you use them. (Please keep using strict! Sure, you could make the errors go away by droping it, but that won't help you solve your problem.)

If, after examining the errors you're generating, post again and include the errors. We can explain them to you, but only after we've seen them!

-sam

Replies are listed 'Best First'.
Re^2: Zipping Files
by Anonymous Monk on Jun 26, 2006 at 21:44 UTC
    I am sorry, but had only missed one line, but here it is:
    #!/perl/bin/perl -w use strict; use warnings; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use File::Find; use Archive::Zip qw( :ERROR_CODES :CONSTANTS ); # @chunks could be: file1.txt file2.txt file3.txt or more files or jus +t one my ($arch_path, $dir_archive_name, $outname, my @chunks); my $htdocs_out; open $htdocs_out, '>', "$arch_path/$dir_archive_name/$outname" +or die $!; foreach my $chunk_file(@chunks){ my $chunk_zip = Archive::Zip->new(); my $chunk_zipped; $chunk_zipped = $chunk_zip->addFile( $chunk_file ); print $htdocs_out $chunk_zipped; } close $htdocs_out or die $!;
    Thanks again!
      I don't think addFile() is returning what you think it is. I think you need to use one of the write*() methods in Archive::Zip instead of trying to print out each chunk yourself.

      If that's not it, why don't you tell us what exactly the problem is. Do you get an error message? A corrupt file? Something else?

      -sam