SPUG: printing reports

North, Walter wnorth at state.mt.us
Fri Feb 8 13:53:03 CST 2002


Hi all, hope you can help me.

I've got a problem which I can't seem to figure out.
I have serveral data files which depending on a certain
criteria have to be printed out to different formats.

The first report does just fine but when I get to the second
report it does not print the  top until the 2nd page, even if
it uses the same format as the previous report.  This behavior
continues through out the remaining reports no matter the
format used.

The data, however, comes out with the right format even on the 
headerless first page and starting with what should be page 2
I get the header for page 1 and the data for page 2. 

I use the following to define the format for each data file.

Use IO::Handle;
open PRTFILE, ">>$PRTFILE" or die "blah blah\n";
If ($TYPE eq "A") {
PRTFILE->format_name("APRTFILE");
PRTFILE->format_top_name("APRTFILE_TOP");
	while (<SOMEFILE>) {
	< do some stuff >
       write PRTFILE;
	}

} elsif ($TYPE eq "D") {

PRTFILE->format_name("DPRTFILE");
PRTFILE->format_top_name("DPRTFILE_TOP")
	while (<SOMEFILE>) {
      < do some stuff >
      write PRTFILE;
      }
}


I'm sure its pretty simple, but for some reason I am baffled.

TIA


----------------------------------------------------- 
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