split long string over two lines

T

TechCrazy

I usually have to compose long strings like

my $result = "....."

which can go over multiple lines. I know C++ uses \ to allow multi-line
strings. How does Perl allow this?

I know I can do this:

my $result = "....." .
"....."

Any other way? Thanks.
 
S

Simon Taylor

TechCrazy said:
I usually have to compose long strings like

my $result = "....."

which can go over multiple lines. I know C++ uses \ to allow multi-line
strings. How does Perl allow this?

I know I can do this:

my $result = "....." .
"....."

Any other way? Thanks.

See this discussion of 'here documents'.

http://www.stonehenge.com/merlyn/UnixReview/col12.html

Also see the "Quote and Quote-like Operators" section in the
perlop page:

perldoc perlop


Regards,

Simon Taylor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top