Why do you want to specify newlines explicitly as \n? If you are generating a significant document, why are the strings even part of the code file? Separate the text from the code and you can send out different languages; your designers can rearrange the message with insignificant change to the program.

Put message snippets into separate text files, if you need various options, laid out exactly as you want it to look. If you want to interpolate data in the middle of standard text, use one of the templating modules, some of them work for text, not just html.

As Occam said: Entia non sunt multiplicanda praeter necessitatem.


In reply to Re: Formatting Strings Without Interpolating Whitespace by TomDLux
in thread Formatting Strings Without Interpolating Whitespace by BJ_Covert_Action

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.