in reply to sequential file handling (yet again)
use File::Copy; @dirs=qw(FullPathToDir1 FullPathToDir2 etc); while(1){ $dir="FullPathToMain"; opendir(MAIN,$dir) or die "Can't open $dir:$!"; while(defined($file = readdir MAIN)){ next if $file =~/^\.\.?$/; $path=$dir.$file; $newdir=@dirs[$i]; move($path,"$newdir$file") or die "move failed:$!"; $i++; undef $i if ($i>$#dirs); } }
|
|---|