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

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]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2016-10-25 13:22 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (320 votes). Check out past polls.