in reply to Format headers and filehandles
Add this:
after your second open. I'm not intimately familiar with format and write, but this does the trick for me. Maybe someone more experienced could explain the magic, but this basically forces a new page on the next write.select DM; $- = 0;
In Section
Seekers of Perl Wisdom