in reply to 500 Internal Server Error defies debugging

Hello AM,

While I cannot give you an exact answer, I have noticed that you're printing two content types.

Perhaps the Content-type in the BEGIN block should be removed.

As a point of reference, I would check out Ovid's CGI Course. See lesson two for why you shoud use CGI;