my $response; { # Protect the parent script's environment. # I hope this doesn't remove %ENV's magic. local %ENV = %ENV; $ENV{SERVER_PROTOCOL} = 'HTTP/1.0'; $ENV{REQUEST_METHOD} = 'GET'; # To build URLs. $ENV{SERVER_NAME} = 'www.example.com'; $ENV{SERVER_PORT} = 80; $ENV{SCRIPT_NAME} = '/some_script.cgi'; # For /xxx.cgi/path delete $ENV{PATH_INFO}; delete $ENV{PATH_TRANSLATED}; # Unset these for POST. $ENV{QUERY_STRING} = 'blah=foo&larh=bar'; # Set these for POST. delete $ENV{CONTENT_TYPE}; delete $ENV{CONTENT_LENGTH}; $ENV{REMOTE_ADDR} = '127.0.0.1'; # Need to place data on child's STDIN for POST. # Need to place data on paramater line for ISINDEX queries. $response = `perl some_script.cgi`; }