The wanted() function does whatever verifications you want. $File::Find::dir contains the current directory name, and $_ the current filename within that directory.