use strict; use warnings; use File::Find; &find(\&wanted, 'find_tmp'); sub wanted { /^foo$/ && print("$_\n"); }