... next if grep { warn "Checking if $_ =~ /$file/"; /$file/ } @array_code; ...