The trick is to make sure that your output file has the same name as your
main format routine.
So in my case I have:
select ("STDOUT");
and
format STDOUT =
The STDOUT_TOP is automatically selected at the beginning of each page.
Maybe this will help (that is if it is not too late)
The output looks like this:
Annual Report on Car Sale January-2002
Page: 1
______________________________________________________________________________________
Column Column Column
Column
One Two Three
Four
______________________________________________________________________________
Blue_car_col_1 Blue_car_col_2 Blue_car_col_3
Blue_car_col_4
Red_car_col_1 Red_car_col_2 Red_car_col_3
Red_car_col_4
Blue_car_col_1 Blue_car_col_2 Blue_car_col_3
Blue_car_col_4
Red_car_col_1 Red_car_col_2 Red_car_col_3
Red_car_col_4
Blue_car_col_1 Blue_car_col_2 Blue_car_col_3
Blue_car_col_4
Red_car_col_1 Red_car_col_2 Red_car_col_3
Red_car_col_4
Blue_car_col_1 Blue_car_col_2 Blue_car_col_3
Blue_car_col_4
Red_car_col_1 Red_car_col_2 Red_car_col_3
Red_car_col_4
Blue_car_col_1 Blue_car_col_2 Blue_car_col_3
Blue_car_col_4
______________________________________________________________________________________
MAIN PROGRAM. Kind of raw.
-----------------------------------------------------------------------------
#!/opt/local/bin/perl
$CUR_TIME=`date "+%B-%Y"`;
$TITLE="Annual Report on Car Sales";
select ("STDOUT");
$~ = STDOUT;
for ($i = 1; $i <10; $i++) {
$color = "Red";
if ( $i % 2 ) { $color = "Blue"};
$col1 = "${color}_car_col_1";
$col2 = "${color}_car_col_2";
$col3 = "${color}_car_col_3";
$col4 = "${color}_car_col_4";
write STDOUT;
if ( $i % 5 == 0 ) {
$~ = STDOUT_BLANK; write STDOUT_BLANK;
$~ = STDOUT;
}
}
$~ = STDOUT_BOTTOM; write;
#----------------------- OUTPUT FORMAT BEGINS HERE -------------------
format STDOUT =
@<<<<<<<<<<<<<< @>>>>>>>>>>>>> @<<<<<<<<<<<<<<<
@|||||||||||||||||||||
$col1, $col2, $col3, $col4
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]