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

In reply to Re^2: Format problems by berlins
in thread Format problems by berlins

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.