http://qs1969.pair.com?node_id=747861


in reply to CGI script gives "internal server error"

CGI notwithstanding, the error is in your here-doc syntax. In Perl, here-docs must be created in the following ways:
print <<NO_SPACE_BETWEEN_THE_ANGLE_BRACKETS_AND_THIS_TEXT; ... NO_SPACE_BETWEEN_THE_ANGLE_BRACKETS_AND_THIS_TEXT # or print << "SPACE_ALLOWED_WHEN_THIS_TEXT_IS_QUOTED"; ... SPACE_ALLOWED_WHEN_THIS_TEXT_IS_QUOTED
This is documented in perlop: "There must be no space between the '<<' and the identifier, unless the identifier is quoted. (If you put a space it will be treated as a null identifier, which is valid, and matches the first empty line.)"

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
Nos autem praedicamus Christum crucifixum (1 Cor. 1:23) - The Cross Reference (My Blog)