- or download this
opendir (DIR, $dir) or die "cannot opendir $dir";
foreach my $file (readdir(DIR)) {
&process_file ($file);
}
closedir (DIR);
- or download this
my @only_files = grep {-f "$dir/$_"} readdir(DIR);
foreach my $file (@only_files) {
&process_file ($file);
}
- or download this
map {&process_file} grep {-f "$dir/$_"} readdir(DIR);