chdir ($scandir); opendir(DIR,'.'); @files=grep {-f $_} readdir(DIR);