next unless $file =~ m/^ AB \s DAT .* \.doc $/x; #### next unless substr($file,0,6) eq 'AB DAT' and substr($file,-4) eq '.doc' ;