Jan 022011
Multi-line string in Perl
Answer:
To assign a multi-line string to a variable in Perl, is easy with the following trick:
my $html = <<END;
<p>
This is HTML content.
</p>
END
print $html;
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Multi-line string in Perl
Answer:
To assign a multi-line string to a variable in Perl, is easy with the following trick:
my $html = <<END;
<p>
This is HTML content.
</p>
END
print $html;