Hi All:

I'm trying to switch from using old-style formats to those provided by Perl6::Form. Simple reports seem to work fine, but now I'm trying to convert several scripts that retrieve a list of column values from MySQL and then print a formatted list of the returned results. Thebse can be several pages in length, so I was trying to use the 'page' and 'header' options to print headings at the top of each page, breaking the list at a defined page size. From the documentation, I can't put this together so it works. The script basically prints inside a loop which fetches each selected row from the database. If I try

print form { page => { length => 10, number => 1, feed => "\f", footer => "\n", header => { first => "================================ +=====================================\n" . "| xxxxxxxxxxxx +xxxxxxxxxxxxxxxx |\n" . "| xxxxxxxxxx +xxxxxxxxxxxx |\n" . "| + |\n" . "| List +of Players |\n" . "|=============================== +====================================|\n" . "|Last |First + |MI|Suffix|Nickname | ID|\n" . "|_______________________________ +____________________________________|", other => "================================ +=====================================\n" . "| List +of Players |\n" . "|=============================== +====================================|\n" . "|Last |First + |MI|Suffix|Nickname | ID|\n" . "|------------------------------- +------------------------------------|", } } };

before the loop and then use another 'print form' inside the loop to print the values from each row, I get the first page headers followed by enough blank lines to fill a page, then the normal list of rows. Not what I wanted. If I try putting the page/header information in the single 'print form' inside the loop, I get get the first page header pluse the row information for each and every row. Also not what I want.

Obviously, I'm misunderstanding something, but what? I searched the web for eamples of using Perl6::Form, seeking understanding, but found none.

I would be eternally appreciative of any help you could offer. Thanks.


In reply to Headings in Perl6::Form by BigJerry

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.