in reply to Re^2: Zipping an array problem
in thread Zipping an array problem
Get some rest;) You'll work better for it.
You need to chop @files into chunks of 3,000, or less for the end. I'll not duplicate all the code, this is just an outline.
use List::Util qw(min); foreach my $seq ( 0 .. $#files/3_000 ) { my $zip = Archive::Zip->new(); my $start = $seq * 3_000; my $end = min ( $#files, $start + 2_999 ); foreach my $i ( $start .. $end ) { $zip->addFile( $files[$i], basename $files[$i] ); } $zip->writeToFileNamed("test-$seq.zip"); }
|
|---|