in reply to How to automate construction of directories?
Also, do you always group together directories in chunks of ten? If the answer to all these is "yes", then something like this may do the trick:
my $chunk_size = 10; foreach my $chunk (0 .. 10_000 / $chunk_size) { my $start = $chunk * $chunk_size; my $end = $start + $chunk_size - 1; # I say "${start}" to keep it from being interpreted as $start_ mkdir "2005/${start}_$end" or die "can't mkdir: $!"; foreach my $client ($start .. $end) { mkdir "2005/${start}_$end/$client" or die "can't mkidir: $!"; foreach (qw/addendums current archive/) { mkdir "2005/${start}_$end/$client/$_" or die "can't mkidir +: $!"; } } }
(I didn't test this.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to automate construction of directories?
by CountZero (Bishop) on Jan 05, 2005 at 21:52 UTC | |
by gaal (Parson) on Jan 06, 2005 at 08:11 UTC |