use File::Find find( sub {print "I have found $File::Find::name\n" if /\.pl$/;}, "/path/to/dir");