in reply to $ENV{HTTP}, environment variables, javascript, javascript.pm, setting for a current page

I can't speak to #1 because you haven't given enough information. Perhaps you can reply to your post with error messages or more detail than saying "I had a problem".

As for #2, the right way to set those environmental variables is to let the web server set them. If you're providing those only as an example of environmental variables you want to set, then, yes, that is the correct way to set them.

I don't entirely understand your question about the print statement. If you want to display what the *web server* set for the SERVER_NAME or SCRIPT_URI, then assigning them new values before you print them is guaranteed to clobber the original settings.

Another helpful tip -- using the -w and -T flags and the strict module is highly recommended when writing CGI scripts. It will save you much grief in the future.

  • Comment on Re: $ENV{HTTP}, environment variables, javascript, javascript.pm, setting for a current page