Re: [PATCH] multiple heredoc beginning in the same line
| Newsgroups | perl.perl6.language |
|---|---|
| Message-ID | <20161202094531.zza2e75lkvpp7m3q@fjorfdeb> |
On Thu, Dec 01, 2016 at 10:46:17AM -0600, [email protected] wrote: > Hmm: > $ cat /tmp/here.pl6 > my ($first, $second) = qq:to/END1/, qq:to/END2/; > FIRST > MULTILINE > STRING > END1 > SECOND > MULTILINE > STRING > END2 > say "f: $first, s: $second"; > > $ perl6 /tmp/here.pl6 > f: FIRST > MULTILINE > STRING > , s: SECOND > MULTILINE > STRING > > > I'd expected $second to have both strings, as its here doc seems to start > at "FIRST" and go to END2 ... or am I misreading this? Freely rephrasing POSIX[1] to adapt it to Perl6 the description could be : The first here-document begins after the next <newline> and continues until there is a line containing only the delimiter (possibly preceded by spaces) followed immediately by a <newline>, Then the next here-document starts, if there is one. So it is expected that $second does not include $first. [1]: http://pubs.opengroup.org/onlinepubs/007904875/utilities/xcu_chap02.html#tag_02_07_04