That Perl says:
"Can't find string terminator "" anywhere before EOF"
instead of:
"Help! There's some whitespace before the second one"
is:
TRULY PATHETIC | [reply] |
The behaviour can't be changed because of backwards compatibility. The best that can be done is too clearly document the trap, and that has been done. Perl 6, not constrained by backwards compatibility, does allow whitespace before the token.
| [reply] |
to be fair, if you place:
use diagnostics;
at the start of the code it will say:
"If you're getting this error from a here-document, you may have included whitespace before or after your closing tag. A good programmer's editor will have a way to help you find these errors."
| [reply] [d/l] |