Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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.

    Cheers,
    Brady C. Jackson

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://948854]
help
Chatterbox?
LanX new life as prawn ... hmmm
[Eily]: LanX that sounds fishy to be honest

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-06-29 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (662 votes). Check out past polls.