in reply to Re: Quote and Quote-like Operators
in thread Quote and Quote-like Operators

I'm sorry; I don't understand your heredoc-stacking example. Would you be able to offer a use case compelling to the Perl newcomer?

Let's refrain from discussing nesting delimiters in generic quotes; I'm not sure I'd want to encourage it. To the newcomer, I'd rather emphasize the value of choosing delimiters wisely.

Full details are always available in perlop. I'd hoped to avoid mentioning usage such as q][] in a basic introduction. Thank you for your comments.

Feste: Misprison in the highest degree. Lady, cucullus non facit monachum. That's as much to say as, I wear not motley in my brain....

Replies are listed 'Best First'.
Re^3: Quote and Quote-like Operators
by tobyink (Canon) on Dec 16, 2011 at 18:01 UTC

    I thought the example I provided, where you want to pipe some multi-line input data through a function, and compare the result to an expected set of multi-line output data, is a fairly realistic example of where stacking heredocs might be used. I won't claim to use stacked heredocs on a frequent basis, but I have used them from time to time, and have seen them used by others.

    I use it in this test file for example:

    http://api.metacpan.org/source/TOBYINK/XML-LibXML-PrettyPrint-0.002/t/03indent.t