in reply to using split on a file
while (<INFILE>) { next LOOP if /^%/; #process segment here } [download]