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.


In reply to Re: $ENV{HTTP}, environment variables, javascript, javascript.pm, setting for a current page by chromatic
in thread $ENV{HTTP}, environment variables, javascript, javascript.pm, setting for a current page by heyman

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.