rzward has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

Please let me know if I am posting this in the wrong place.

I have a machine that is running Apache/1.3.26 (Unix) mod_perl/1.27 on Linux.

My Perl script handles form submissions and checks the environment variable CONTENT_TYPE via $ENV{'CONTENT_TYPE'} before parsing the information coming from the Web page. The script expects CONTENT_TYPE to be 'application/x-www-form-urlencoded'. Otherwise, the script halts with an error message.

This script has been working for years on many different machines including this one. But now, interimittently, on this machine, when the script checks the CONTENT_TYPE environment variable it finds it empty.

Unfortunately, I am not an administrator of the machine. Also, this installation of Apache supports a product called Blackboard, which appears to require that all URLs be redirected to themselves plus a ?batt=Y added to the end. The configuration is complicated, I'm sure and I don't understand it well.

I'm confident the problem lies either in the interaction between mod_perl and Apache or the configuration of the Apache Web server.

My questions are:

1. Under what circumstances can the CONTENT_TYPE environment variable be set to nothing when the script program is called from a Web page via something like

<FORM ACTION="http://myserver.edu/cgi-bin/myscript.pl" METHOD="POST"> ... </FORM>

2. Is it possible for aliasing or redirecting from Apache to cause the CONTENT_TYPE to be reset? It feels like a timing issue because half the time it works and the other half the CONTENT_TYPE environment variable is empty.

Any advice would be greatly appreciated.

Thank you in advance.

Richard

Originally posted as a Categorized Question.

  • Comment on CONTENT_TYPE environment variable sometimes empty when posting a form?