in reply to using split on a file
LOOP: while (<INFILE>) { next LOOP if /^%/; #process segment here }
Hope this helps, and that it shows up right this time.
Egg, YAPH-and-BOFH-wannabe