Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Populate CGI from HTTP::Request wo/ using %ENV ?

by CountZero (Bishop)
on Mar 09, 2008 at 22:40 UTC ( #673143=note: print w/replies, xml ) Need Help??

in reply to Populate CGI from HTTP::Request wo/ using %ENV ?

RFC 3875 says that the meta-variables (which include the QUERY_STRING) are passed to the script in identically named environment variables. These are accessed by the C library routine getenv() or variable environ. (item 7.2 of RFC3875).

As thus the environment variables are populated outside of your script by the server, you will have to find a way to capture these variables in a local data structure before messing around with them.


A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

  • Comment on Re: Populate CGI from HTTP::Request wo/ using %ENV ?

Replies are listed 'Best First'.
Re^2: Populate CGI from HTTP::Request wo/ using %ENV ?
by ikegami (Pope) on Mar 09, 2008 at 23:29 UTC

    There's no relation between CGI (the protocol) using the environment and the need to create a CGI object from a HTTP::Request object.

    For example, CGI (the module) can already create an object from an Apache::Request object without touching the environment.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://673143]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2018-01-18 01:17 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (206 votes). Check out past polls.