use File::Find; find(\&wanted, @directories_to_search); sub wanted { ... } #### $File::Find::dir is the current directory name $_ is the current filename within that directory