I'd like to use perl's format feature, but to have it also pad certain fields with underscores,
eg to make header lines indicate the exact lenghts the values in the actual report lines take
eg
format TOP =
@||||||||||||||||||| @||||||||||||||||| @|||||||||
$c1, $c2, $c3
.
$c1 = "first column";
$c2 = " this month";
$c3 = " other data";
write;
should come out as
____first column____ ____this month____ other data
or (if spaces in the string could also be replaced:
____first_column____ ____this_month____ other_data
The idea is that the underscores make it easier to see later how long a field
Is this possible? Is there maybe an internal variable containing te character
used for padding when '|' us used in a format description?
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.