This and other RFCs are available on the web at
http://dev.perl.org/rfc/
=head1 TITLE
Here Docs Terminators (Was Whitespace and Here Docs)
=head1 VERSION
Maintainer: Richard Proctor <[EMAIL PROTECTED]>
Date: 16 Aug 2000
Last Modified: 2 Sep 2000
Mailing List: [EMAIL PROTECTED]
Version: 3
Number: 111
STatus: Developing
=head1 ABSTRACT
With a here doc print <<ZZZ; the ZZZ has to be at the start of a line and the
text of the here doc, is processed verbatum. This results in the terminator
sticking out in the body of the document, makes indenting blocks of text
difficult and causes errors and confusion.
There are several FAQs that relate to this problem. This proposal tidies
this up.
=head1 DESCRIPTION
Perl6 should ignore any whitespace before the terminator of a heredoc on any
line. Further it should ignore any whitespace ";"s (and comments) that
follow the terminator. Perl should also ignore whitespace between the << and
the terminator.
Discussion took place on allowing statements following the terminator, but
generally these where thought of as a bad idea. So only ";" and comments
should occour on the same line.
All of these should work:
print <<EOL;
EOL
print << EOL;
EOL
print << EOL;
EOL;
print << EOL
EOL;
print <<EOL ;
EOL # this is the end of the here doc
print <<EOL
EOL; # this is the end of the here doc
print <<EOL ;
EOL; # this is the end of the here doc
But this should be an error:
print <<EOL
EOL; $i++;
=head1 IMPLENTATION
This should be a relatively simple addition to perl
(I think just to scan_heredoc in toke.c + docs in perl5)
=head1 CHANGES
RFC111 V1 Had two concepts, one about the terminator and another about the
content. This has been split into two concepts, this RFC and RFC 162.
RFC111 V2 Just had the termination issue, and # commets after the
terminator
RFC111 V3 Adds the ";" as acceptable after the terminator (and more examples)
=head1 REFERENCES
RFC162 Filtering Heredocs (was originally part of RFC 111 V1)