in reply to •Re: Top of format won't print
in thread Top of format won't print

I didn't know that, but I'm skeptical -- which confuses me, considering the source. The actual "top of report" from yesterday (formatted to fit the text window - along with the beginning of the main body of the report):

Page: 1 End of day register report Mon Jul 8 18:10:38 2002 Run by: Ovid Terminal: some.terminal Total Sales --------------- 12.34

I just typed that in directly from a test report sitting by my right hand.

From perldoc -f write (emphasis mine):

Top of form processing is handled automatically: if there is insufficient room on the current page for the formatted record, the page is advanced by writing a form feed, a special top-of-page format is used to format the new page header, and then the record is written. By default the top-of-page format is the name of the filehandle with "_TOP" appended, but it may be dynamically set to the format of your choice by assigning the name to the "$^" variable while the filehandle is selected. The number of lines remaining on the current page is in variable "$-", which can be set to "0" to force a new page.

And from page 123 of the 2nd Camel (emphasis mine):

Top-of-form processing is by default handled by a format with the same name as the current filehandle with "_TOP" concatenated to it. It's triggered at the to of each page.

So, perldoc mentions something about a "special top-of-page format" used to format new page headers, but this seems very unclear. What "special" format. How does this differ from the current "top-of-page" format? This program used to do what I want and now it doesn't. I've also heard that our client has had intermittant problems with this. Seems like a bug, but whether it's in my code or Perl, I don't know. I suspect a bug in the documentation, actually :) I'd be happy to submit a doc patch to P5P, if I knew what I was patching (if, in fact, unclear docs are the problem).

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.