in reply to print or die

When dealing w/ a heredoc string you put your "or die" w/ the original print statment:
print FILE <<UNTIL_I_SAY_STOP or die "ERROR Writing to FILE: $!"; blah, blah, blah UNTIL_I_SAY_STOP
It works similarly whenever you want to do something else after the heredoc...
my $sub=substr(<<EOT,3,3); abc123def EOT print "sub=\"$sub\"\n";
prints out 123.

You can even get fancy (or hard to read depending on your preference) and use multiple heredocs in the same call:

print <<EOT1,<<EOT2; foo EOT1 bar EOT2