#!/usr/bin/perl -w use strict; use File::Find; # within the wanted subroutine: # # http://perldoc.perl.org/File/Find.html # $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. my @directories_to_search = ('C:/temp'); find(\&wanted, @directories_to_search); sub wanted { print "$File::Find::name\n" if -f; }