in reply to How to execute the perl program on different files in the same directory
opendir DIR, "Dir_With_Files" or die "Cannot open diretory: $!"; my @files = grep { /\.txt$/ } readdir DIR; closedir DIR; foreach my $file (@files) { do stuff; } [download]