SPUG: More printing reports

North, Walter wnorth at state.mt.us
Mon Feb 11 10:19:25 CST 2002

Thanks to Colin for his attempt to aid me but perhaps I did not make 
myself compeletely clear.  I tried a number of variations but still
end up the same.  No header on 1st page of my reports after the first

This is a description of what I'm trying to do:
I have a series of reports I want to print as I process them thru a perl
The first one prints out just fine, the next one does not print the header
at the top of the 1st page.  Instead it prints it at the top of the 2nd page
calling it page 1 even tho its page 2.  All data comes out perfectly.

I am doing this.  ( different then my first post, but same result )

use FileHandle;
# loop thru a list of files
foreach $FILE (@LIST_OF_FILES) {
	< Do some stuff like create PRTFILE based on FILE etc > 
	open FILE, "<$FILE" or die "blah blah"
	open APRTFILE, ">>$PRTFILE" or die "blah blah";
		# loop thru the contents of FILE
		while (<FILE>) {
		<do some stuff to create the output line>
		write APRTFILE;
	} # end of loop thru a file
close FILE;
} # end of loop thru a list of files

First report comes out perfectly, page 1 header on page 1 followed by data, 
page 2 header on page 2 followed by data, etc.

All subsequent start with the data on page one then on page 2 the header 
claiming to be page one (even tho its page 2) and then the data and 
so on thru the reports.

I obviously have missed something simple because this should be a simple
thing to do.


Walter North 406-444-2914 
Operating Systems Programmer 
wnorth at state.mt.us

A prohibitionist is the sort of man one wouldn't care to drink with
-- even if he drank.
                -- H.L. Mencken


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org

More information about the spug-list mailing list