From: "Peter J. Holzer" <[EMAIL PROTECTED]>
> As an aside, the SPL programming language[2] allows the terminator of a
> here document to be indented and to strip off everything up to and
> including some character from each line, so that could be written like
> this:
>
> function foo() {
> some;
> code;
> here;
> if (bla) {
> more;
> code;
> here;
> var sql = >>SQL|
> |SELECT
> | jo.departure_date AS departure
> |, eq.name AS equipment
> |, dp.full_city AS departure_city
> |, ap.full_city AS arrival_city
> |, ca.name AS carrier_name
> |, jo.number
> |[...]
> SQL;
> even;
> more;
> }
> code;
> here;
> }
That kinda defeats the purpose of heredocs, namely allowing me to
copy&paste some data into/out of the script without having to escape
or modify anything. If you do this and then need to test and tweak
the SQL in some UI provided by your database you have to go and strip
and later reintroduce the |s. Not for me, I'd rather have a few lines
that are not indented. They are colored differently by my editor so
they stand out anyway. And in this case I can indent them as much as
I like anyway so it's just the terminator ... who the heck cares. The
only time I care is when I increase the indentation of the block
containing the heredoc ... if I could convince my editor to not
indent inside heredocs and the terminator if I select more code I'd
be completely happy.
Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery