in reply to CGI Parameters

You need to read perldoc CGI.

You'll find those variables in:

param('DELIVERMESSAGE') param('MESSAGECOUNT')

etc. I imagine it's these that your manager is refering to when he means HTTP header variables, so there's one you would access as param('Comms-Branch').

--
TTTATCGGTCGTTATATAGATGTTTGCA

Replies are listed 'Best First'.
Re: Re: CGI Parameters
by ysth (Canon) on Jan 12, 2004 at 03:38 UTC
    I'd assume that HTTP header variables means it's sent in the HTTP header or possibly as a cookie. Don't know if the CGI http() method will get you access to arbitrary header settings; perhaps it depends on what web server you are using. For cookies, see CGI.

    A quick look at the source reveals CGI's http() method just looks for environment variables starting with HTTP.

    Update: as 3dan and etcshadow say, the server uppercases the header labels and prepends HTTP_ to make them available in the environment. (I wonder if this is actually reliable for arbitrary headers on all servers.)

      The CGI->http method lets you access those environment variables starting with 'HTTP', yes. But what you seem to be missing is that those environment variables are set by the webserver to the value of the HTTP headers sent in the request. For example, if you sent this request to you CGI:

      GET /my_cgi.pl HTTP/1.1
      Host: localhost
      Foo: FOO Content here
      
      

      ...then the following code should get you the value 'FOO Content here':

      use CGI; my $q = CGI->new; my $foo_content = $q->http("Foo"); # or $q->http("HTTP_FOO")

      Update: I see that etcshadow dealt with this in full elsewhere in the thread... hey, a little repetition never hurt anybody, right?

      --
      3dan