while (<>) { chomp; next if 1 .. /^internal name/; print "Found pattern at line $.\n" if /^need this/; }