unless (opendir(DIR,$scandir)) { confess "can't open the directory $scandir: $@"; } @files=grep {-f "$scandir/$_"} readdir(DIR);