Talk:Here document: Difference between revisions

Content added Content deleted
Line 12: Line 12:


Some examples here seem like basically multi-line string literals. So I want to ask: Are any multi-line string literals allowed? (I'm guessing the answer is probably no?) And if not, what is the dividing line that separates "here documents" from other multi-line string literals? Is it that it allows you to use a custom word of your choosing as a delimiter? (Python triple-quotes and many others do not satisfy this.) Is it that it allows you to use a delimiter that is more than one character? What is the criterion? --[[User:Spoon!|Spoon!]] 07:58, 11 July 2011 (UTC)
Some examples here seem like basically multi-line string literals. So I want to ask: Are any multi-line string literals allowed? (I'm guessing the answer is probably no?) And if not, what is the dividing line that separates "here documents" from other multi-line string literals? Is it that it allows you to use a custom word of your choosing as a delimiter? (Python triple-quotes and many others do not satisfy this.) Is it that it allows you to use a delimiter that is more than one character? What is the criterion? --[[User:Spoon!|Spoon!]] 07:58, 11 July 2011 (UTC)

:I think the distinctions are:
:1 end delimiter takes a line by itself.
:2 the text can get inserted in the middle of the line that invokes it.
:--[[User:Rdm|Rdm]] 08:14, 11 July 2011 (UTC)