Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jul 242010
 

Multiline string in Perl

Answer:

You can either use the q operators.

my $s = q#''''"
test
"""'
#;
print $s;

Or qq operators if you need interpolation.

my $d = "test";
my $s = qq#''''"
$d
"""'
#;

print $s;

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>