On Thu, 14 Sep 2000 03:11:54 -0400, Michael G Schwern wrote:

>The current stumper, which involves problems 1, 2 and 3 is this:
>
>   if( $is_fitting && $is_just ) {
>        die <<POEM;
>            The old lie
>          Dulce et decorum est
>              Pro patria mori.
>        POEM
>   }
>
>I propose that this work out to 
>
>    "    The old lie\n  Dulce et decorum est\n      Pro patria mori.\n"
>
>and always work out to that, no matter how far left or right the
>expression be indented.

I happen to disagree, and here's why. To me, here docs are like *literal
extracts* from text documents that you want to reproduce. *Nothing* is
supposed to be changed about it: the result should be *exactly* what it
is in the here doc, apart from interpolation in double-quotish here
docs.

I very often insert (parts of) text files produced by other people, and
I don't want to be forced to indenting all of it, every single line.

However, the same does not count for the here doc terminator. This one
very often trips me up. Since this may not be randomly indented, I lose
sight of my code indentation, and as a consequence I forget closing
braces for blocks etc. Annoying.

Another problem is the trailing whitespace: invisible, yet extremeley
important: there should be none.

Being freed of these two concerns, that boil down to one thing: leading
and trailing whitespace, would be most welcome.

I do not mind having an option of loosing some leading spaces or tabs
for here docs. However, I'm already pretty sure that if this is
optional, I won't ever use it. So please, do not force it down my
throat.

-- 
        Bart.

Reply via email to