Yes, I am trying to force the top of page to print without issuing a number of writes. The Gov't contract uses perl 5.005.03 and upgrading is difficult. The following is the prtion of code where the problem occurs. The logic stating with: print ("what the hell!!!\n"); executes however the decrement to the $- variable does not take as wel as setting $- to 0 and the write of the format top does not execute.
while (%data = &dbnextrow($dbproc05,1))
{
if ($numRows == 0)
{ $numRows = 49;
}
if ($first_time == 1 )
{
$dataRows = 1;
$old_edgar_id = $data{"edgar_id"};
$edgar_id = $data{"edgar_id"};
$blk_count = $data{"blk_count"};
$first_time = 0;
format_top_name REPORT "REPORT_TOP";
format_name REPORT "BLANK_FORMAT";
write (REPORT);
$numRows = $numRows - 11;
}
$edgar_id = $data{"edgar_id"};
if ($old_edgar_id eq $edgar_id)
{
format_name REPORT "DATA_FORMAT2";
write (REPORT);
$numRows--;
}
else
{
$old_edgar_id = $data{"edgar_id"};
$blk_count = $data{"blk_count"};
if ( $numRows >= 7 )
{
format_name REPORT "COL_NAME_FORMAT";
write (REPORT);
$numRows = $numRows - 7;
}
else
{
print ("what the hell!!!\n");
$- --;
$- --;
$- --;
$- --;
$- = 0;
format_top_name REPORT "REPORT_TOP";
format_name REPORT "BLANK_FORMAT";
write (REPORT);
$numRows = $numRows = 49;
}
$accession_number = $data{"accession_number"};
$sub_type = $data{"$sub_type"};
$received_date = $data{"received_date"};
format_name REPORT "DATA_FORMAT2";
write (REPORT);
$numRows--;
}
}
|