sub find_process { ... if (length($file) < $x) { warn("Skipping file $file\n"); return; } ... substr($file, $x, ...) ... ... }