Logo

Programming-Idioms

History of Idiom 48 > diff from v1 to v2

Edit summary for version 2 by :

Version 1

2015-05-06, 21:04:50

Version 2

2015-07-31, 20:15:11

Idiom #48 Multi-line string litteral

Assign to variable s a string litteral consisting in several lines of text

Idiom #48 Multi-line string litteral

Assign to variable s a string litteral consisting in several lines of text

Code
$s = "Perl normally allows
strings to contain newlines.";

$s =<<EOSTR;
However, it also provides the "here doc" (lifted from various UNIX shells).
A 'here doc' is the <<tag construct.  Perl continues to treat
all the text found as part of the string until there's a line containing
the EOSTR tag at the beginning
EOSTR