chdir $folder or die "Can't chdir to '$folder': $!\n"; my $ret = system("tar -cvzf $tar_file ."); # tar and zip on the fly and die "Couldn't create tarfile '$tar_file': $!\n"; # 'and', not 'or' #### my @ary = splice(@srcfiles,0,1024); my $ret = system("tar -cvf $tar_file @ary") # tar only, no update on 'z' and die "Couldn't create tarfile '$tar_file': $!\n"; while(@ary = splice(@srcfiles,0,1024)) { $ret = system("tar -uvf $tar_file @ary"); and die "Couldn't update '$tar_file': $!\n"; }