There-doc

jmcnamara on 2003-08-08T22:37:00

there-doc (n): an indented here-doc.

    if ($greeting) {

        print << 'EOT';
        hello, world
        EOT

    }


There's no here here.


RFC::Prototype::111

schwern on 2003-08-09T00:59:50

See also RFC::Prototype::111 from back in the initial Perl 6 days. Specificly RFC::Prototype::111. It would be nice if feature #2 was implemented, ie. here-docs not being so sensitive about trailing whitespace in the terminator.

PS Would using "code" instead of "executable" for your filter solve the problem of filtering inside strings?

Re:RFC::Prototype::111

jj on 2003-08-09T20:12:35

Thanks for the suggestions, I'll have a read of RFC111 and add that feature in the next version.

I did try using "code" in the filter when I was first writing the module, however because "code" removes here documents (see &Text::Balanced::extract_quotelike) it doesn't see the terminator strings until the indenting has been removed. Bit of a chicken and egg situation! What I'll try next is to run Text::Balanced over the current line (when a << has been seen) to identify if the << is part of another quote or not.

Cheers,

JJ