use warnings; use strict; use File::Find; # $data_dir is determined. $SIG{__WARN__} = sub { print "Skipping...\n"; # skip the rest of the loop for the file. } sub find_process { # open each file that meets the naming criteria. # begin looping through the file. # attempt to access the substr. # skip this file if there was a substr warning and report it. } find(\&find_process, $data_dir);