But here-docs are so ugly for so many reasons. Not being able to omit the final newline is just one. They also aren't very flexible at interpolating in the middle. They break if you reindent code. Worst of all, they break in the face of invisible whitespace (trailing whitespace is not even indirectly visible in most environments).
Use qq<>.
- tye
In reply to Re: Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context. (qq++)
by tye
in thread Unexpected results when removing a HERE-DOC "ending" newline, with map and/or s/// depending on context.
by olivierp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |