in reply to Run a script on every file in a directory

I'm a fan of File::Find for directory traversing, if you prefer using Perl rather than the shell. Here is some code:

#!perl use strict; use warnings; use File::Find; my $dir = shift; die 'No directory' unless $dir; find( sub { # $File::Find::dir is the current directory name, # $_ is the current filename within that directory # $File::Find::name is the complete pathname to the file. # Process file here... }, $dir ); __END__

You could use file tests, regex matches, etc. to filter out the files that you want.