in reply to here document styling

Essentially what the perl compiler does with heredocs is to replace the heredoc definition with a string equivalent of the contents of the heredoc. By runtime, the heredoc itself is gone. If you do this yourself, mentally, then you will see that:
my $text = <<"EOT" This is my text. EOT ;
and
my $text = <<"EOT"; This is my text. EOT
are identical, and equal to:
my $text = "This\nis\nmy\ntext.\n";
Update: BTW, this lets you do weird things like this:
while ( <<"EOT" =~ m/(.*is.*)/g ) This is my text, isn't it? EOT { print $1,"\n"; }

Impossible Robot