in reply to Format problems

I'm not entirely sure what you're attempting to do here. Are you trying to force the format to go to the next page? Not that I'm sure how to do that, either, as I've avoided formats pretty much since the second day with perl because I found them a bit convoluted at first, and now I just simply don't find them flexible enough. However, Perl6::Form looks promising - maybe you want to look at that to find a simpler way to solve your problem.

Replies are listed 'Best First'.
Re^2: Format problems
by berlins (Initiate) on Aug 17, 2005 at 12:33 UTC
    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--; } }