Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Formatting Strings Without Interpolating Whitespace

by kejohm (Hermit)
on Jan 19, 2012 at 21:56 UTC ( #948854=note: print w/replies, xml ) Need Help??

in reply to Formatting Strings Without Interpolating Whitespace

You could use a here-doc, like this:

my $msg_body_2 = <<"EOT"; line 5 line 6 line7a\tline7b line8 EOT

or you could split the string in to segments spread over multiple lines and concatenate them together:

my $msg_body_2 = "\n\n" . "line 5\n" . "line 6\n" . "line 7a\tline7b\n" . "line 8\n" . "\n\n";

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

    The concatenation option is the simplest and easiest for me to work in now. I'll try to fiddle with some of the other options later, but for now this works perfect. Thanks for the tip kejohm. I didn't realize you could space concatenation operators across multiple lines.

    Brady C. Jackson

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://948854]
[choroba]: Discipulus they probably knew why they wrote the code in C

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2017-10-23 16:11 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (280 votes). Check out past polls.