in reply to How to execute the perl program on different files in the same directory

You could make yourself an array of files to work over using readdir and grep:
opendir DIR, "Dir_With_Files" or die "Cannot open diretory: $!"; my @files = grep { /\.txt$/ } readdir DIR; closedir DIR; foreach my $file (@files) { do stuff; }
  • Comment on Re: How to execute the perl program on different files in the same directory
  • Download Code