When your manager says that "Comms-Branch" is a "HTTP header variable", he means that it is in the HTTP header. The HTTP header is a big chunk of text in the request and the reply. For example, an HTTP request might look something like this:
GET /dir/page.pl HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Referer: http://www.foo.bar/otherdir/otherpage.pl Accept-Language: en-us Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip, deflate User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt) Host: www.foo.bar Cookie: monster=blue; My-Other-Header: yippy yahoo!
All of those lines except for the first one are "headers"... they basically act (sorta) like a perl hash, in that they are name-value pairs. Some of those headers have particular meaning to the web browser and web server (most of them, in fact). However, the user agent (the application making the web-service request in this case) can really put any arbitrary header in there, as long as it doesn't conflict with a name used by a real header.

Anyway, if I wanted to find the value used by, for example, the "My-Other-Header" header... I could find it in the environment by looking at (yes, it does get driven all into uppercase): $ENV{HTTP_MY_OTHER_HEADER}. So, in your example, you could find "Comms-Branch" http header in $ENV{HTTP_COMMS_BRANCH}. For more information, you can examine the environment by putting:

use Data::Dumper; warn Dumper \%ENV;
in your code, and then looking at the error-log. All of the (non-special) HTTP headers get written into the subprocess's environment with the prefix HTTP, all uppercase, and with non-word characters turned to underscore.

Anyway, hope that helps. Oh, and this should be the same whether you are using old-school CGI (not CGI.pm, mind you... but the common-gateway-interface, which CGI.pm is a wonderful tool to help you use) or under mod_perl (again... with or without CGI.pm).

------------ :Wq Not an editor command: Wq

In reply to Re: CGI Parameters by etcshadow
in thread CGI Parameters by Gerard

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.