Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Formatting Strings Without Interpolating Whitespace

by TomDLux (Vicar)
on Jan 20, 2012 at 03:13 UTC ( [id://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?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://948875]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 23:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found