You already mentioned in the CB that you're trying to use File::Find for that solution, and I really recommend it. The below skeleton should get you closer to your solution:
use strict; use File::Find; my $limit = 4 * 1024 * 1024 * 1024; my @source_directories = qw( ); my @files; File::Find::find( sub { push @files, $File::Find::name }, @source_dire +ctories ); my $total; my $basename = "part-"; my $count = 1; my $dirname = $basename . $count; for my $file (@files) { my $size = -s $file; if ($total + $size > $limit) { $total = 0; $count++; $dirname = $basename . $count; print "# 4GB Limit reached, starting new volume $dirname"; }; print "$file => $dirname/$file\n"; };
In reply to Re: Using an array, how do I search one directory area and copy to another area
by Corion
in thread Using an array, how do I search one directory area and copy to another area
by ckaspar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |