opendir SUBM, $curSubmitDir; while (defined (my $fileFrom = readdir DIR)){ move ($fileFrom, $fileTo) or die "$!"; }