while ($name = readdir(ORIG)){ #### while (defined($name = readdir(ORIG))){ #### my @Filenames = readdir ORIG;