while () { # skip everything from line 1 to the #cardtype line unless (1../^#cardtype$/) { # we're past the junk } }