in reply to Processing lines after a pattern in a while loop

Looks like a job for the flip-flop operator (..) as seen in perlop e.g
while(<DATA>) { chomp; next if /^(?:qcp|#)/ .. /^#cardtype/ or 0 == length; # do stuff here }
HTH

_________
broquaint

update: added check for blank lines