; # discard first line $/ = "myrecordsep\n"; while ( ) { #s{$/}{}; # get rid of your separator if you want print; print "---\n"; } __DATA__ myrecordsep field1=item1 field2=item2 ... myrecordsep field1=item9 field2=item10 ...