Glenn Linderman wrote:
>Amen to the below. So can we have an RFC 111 (v4) that gets rid of allowing
>stuff after the terminator? Even the ";" afterward seems useless... the ";"
>should be at the end of the statement, not the end of the here doc. The only
>improvement to here docs I see in this RFC is to allow whitespace before/after
>the here doc terminator. The rest is handled adequately and consistently
today,
>and Tom's dequote is adequate to eliminate leading white space... especially
>among people who cannot agree that a tab in a file means "mod 8" (which it
>does).
The semicolon, as you point out, belongs on the statement at the
head of the here doc. The proposal to allow a semicolon at the end
is mere window-dressing. Aesthetics only. Personally, I have used
editors and pretty-printers that could handle here-docs except that
they thought that the "statement" without a semicolon meant that
all subsequent lines should be indented. I have had to resort to:
$foo = <<HERE;
...
HERE
;
other_statements();
Yes, the obvious solution is to get a better editor/pretty printer.
Not always an option.
But, as I said, it's mere aesthetics. Perhaps not worth changing the
language to accommodate the minority of people who have inferior tools.
But why not allow a comment? Can't think of a use for one?
Michael Schwern, whom you quote, points out that the here doc tag
ought to be self-documenting, and he is 100% correct. But comments
are used for more than documentation. Ever write a note to yourself
or to the next programmer in a comment?
$foo = <<TABLE_OF_GOODS;
...
TABLE_OF_GOODS # must combine with TABLE_OF_SUPPLIES, below, someday
Sure, you can put that comment in a different place, with little harm.
But as long as we're proposing allowing whitespace before/after the
doc tag, comments are a Good Thing, imho.
----------------------------------------------------------------------
Eric J. Roode, [EMAIL PROTECTED] print scalar reverse sort
Senior Software Engineer 'tona ', 'reh', 'ekca', 'lre',
Myxa Corporation '.r', 'h ', 'uj', 'p ', 'ts';