use File::Find; sub process_file { print "$File::Find::name\n" if -f} find(\&process_file, $DIR);