in reply to Why do here-docs have to end with a newline, not EOF?
It seems you'll only get that problem if the last line of your file doesn't end in a newline.
Don't know why that's the case, but otherwise there's no problem having a here document at the end of your program.
In Section
Seekers of Perl Wisdom