I've seen this idiom before and really dislike it for exactly the reasons you describe. My only suggestion, if you want to have a sort of "indented delimiter" is to convert your delimiter spaces to underscores. Using your example, you'd have:
($content = <<"____END") =~ s/^\s{1,4}//gm; <p>$name</p> <ul> <li>foo</li> <li>bar</li> </ul> ____END return $content;
This is resistant to the tab/space problem. On the other hand, it's not quite as clean, and you still have to adjust the regex when the indention changes.
In reply to Re: Better heredocs?
by kyle
in thread Better heredocs?
by dmorgo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |