Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Formatting Strings Without Interpolating Whitespace

by TomDLux (Vicar)
on Jan 20, 2012 at 03:13 UTC ( #948875=note: print w/replies, xml ) Need Help??

in reply to Formatting Strings Without Interpolating Whitespace

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.

  • Comment on Re: Formatting Strings Without Interpolating Whitespace

Replies are listed 'Best First'.
Re^2: Formatting Strings Without Interpolating Whitespace
by BJ_Covert_Action (Beadle) on Jan 20, 2012 at 04:03 UTC

    That would involve expanding this particular script's capabilities far beyond what is needed right now. Down the line I do intend to do exactly as you say (one problem of course, is that if I use external template files then I have to version control the template files if they start getting updated). However, I needed to get something out the door today, and digging through/researching templating modules while simultaneously trying to get my formats right, my parsing right, and my e-mail configuration right was going to require a lot of time that I don't have right now.

    One day, if all goes well, I fully intend to evolve this into a completely modular, badass notification program. But for the time being, that amount of work would not be adding value to my immediate task at hand

    So, long story short, I'm prioritizing.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://948875]
and nobody stirs...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2018-06-22 16:01 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.