as documented in https://perldoc.perl.org/perlop#EOF, it is possible to have multiple adjacent here-documents: ======== print <<"foo", <<"bar"; # you can stack them I said foo. foo I said bar. bar ======== this isn't highlighted properly - the second here-doc isn't treated as such, which of course leads to all kinds of "interesting" followup effects when it contains quotes, etc. for an example with some extra complexity, see https://github.com/git/git/blob/v2.39.2/git-send-email.perl#L843 (yes, github is bungling it, too :-D).