As rinceWind said (and as Larry made official in Apocalypse 6), in Perl 6 formats are being reworked under my evil influence. For a taste of what they'll be like, see the Text::Reform module.

Using that module, your table would be generated like so:

use Text::Reform; my @name = qw(foo foo2 foo3); my @last = qw(bar bar2 bar3); my @count = qw( 3 4 5 ); print form "--------------------------------------------------", "NAME LAST COUNT", "--------------------------------------------------", "[[[[[[[[[ [[[[[[[[[[[[[[[[[[ |||||", \@name, \@last, \@count;
Or, if your data was likely to spill over multiple pages, you might prefer more sophisticated headers and footers:
use Text::Reform; my @name = (qw(foo foo2 foo3)) x 20; my @last = (qw(bar bar2 bar3)) x 20; my @count = (qw( 3 4 5 )) x 20; print form { header => "--------------------------------------------------\n" . "NAME LAST COUNT\n" . "--------------------------------------------------", footer => sub { my ($pagenum, $lastpage) = @_; return "\n\n\nEND OF REPORT" if $lastpage; form "\n\n\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", ".../".($_[0]+1); }, pagelen => 20, pagefeed => "\n\n".("_"x60)."\n\n", }, "[[[[[[[[[ [[[[[[[[[[[[[[[[[[ |||||", \@name, \@last, \@count;
Note in particular the use of a (conditional, nested) call to form within the footer of the main form.

The Perl 6 format syntax will be even more sophisticated than that provided by Text::Reform, since I'll be taking advantage of new features of Perl 6. For example, the named options that control headers/footers/etc won't need to be in hashes, and array arguments won't require an explicit backslash.

There will also be additional formatting modes and options, all of which will eventually be described in Exegesis 7.


In reply to Re: Re: Re: using format to align by TheDamian
in thread using format to align by Anonymous Monk

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.