while (<$input>) { next if 1 .. /\@TYPE xy/; printf ...; }