I have to build a text file in a fixed-width format for feeding into an antiquated autodialer. Using the perl format function I get all the fields properly space-padded with one glaring exception: At the right-hand side I need to pad out the last variable with about fifty spaces before the carriage return, but no matter what I try I cannot get the formatter to pad it. It merely truncates the line at the end of the last character of the last variable without adding the padding specified by my use of @<<<<<<<<<<<< etc. There is no newline char in any of the variables (the line containing one having been chomped off when reading in the data to begin with), so that's not preventing the proper formatting. I can get the formatter to pad spaces up to a final single character of my choosing before the newline, and I can also get the formatter to pad any other characters up to the EOL, but numerous experiments have failed to give me nothing but spaces up to the newline. Please advise.

In reply to Formats and spaces to the EOL by thistle172

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.