find({ wanted =>sub{ if (! ($File::Find::dir =~ /$dir/)) { print "Found a match: $_\n" if (/$rex/);}} , no_chdir => 1 }, $search_root);