RFC 111 (v2) Here Docs Terminators (Was Whitespace and Here Docs)

[email protected] (Perl6 RFC Librarian)
Newsgroups perl.perl6.language,perl.perl6.announce
Message-ID <[email protected]>
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: 27 Aug 2000
	Mailing List: [email protected]
	Version: 2
	Number: 111

=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 (and comments) that follow the
terminator.  Perl should also ignore whitespace between the << and the
terminator.

      All of these should work:
      
      print <<EOL;
EOL
      print << EOL;
   EOL
      print <<EOL ;
EOL     # this is the end of the here doc

=head1 IMPLEMENTATION

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 another RFC.

=head1 REFERENCES
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.