Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2018-07-16 09:24 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (333 votes). Check out past polls.