in reply to sprintf format and print inconsistencies whilst creating fixed width column

newbieperlperson:

Are you by any chance using a proportional font in your mail reader? If so, that may be the cause of the ragged formatting.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: sprintf format and print inconsistencies whilst creating fixed width column

Replies are listed 'Best First'.
Re^2: sprintf format and print inconsistencies whilst creating fixed width column
by newbieperlperson (Acolyte) on Dec 19, 2013 at 19:52 UTC
    I am using a regular font, the sprintf spacing represents exactly what is output to email, i.e. its all over the place, oddly, the print statement shows that the spacing is correct.

      So, if I take the email output, throw it into a notepad document, the doc perfectly aligns as expected.

      It turned out that the font was causing this after all, a few users suggested it and I had looked at the wrong part of outlook for the font I was using for emails received. I needed to use a non proportional font, this link helped. http://stackoverflow.com/questions/12588021/perl-formatted-output-to-email-body

        newbieperlperson:

        In that case, you may want to send the EMail with two bodies, plain text and formatted. If you use HTML, RTF or similar formatting, it's relatively straightforward to get your data to line up even with proportional fonts.

        ...roboticus

        When your only tool is a hammer, all problems look like your thumb.