In an attempt to resolve the issue I posted in this question:
Is it possible to send POST parameters to a CGI script using a system() call?
So far the only successful resolution to the problem is to trick the environment to think the request was a GET. I do this by converting the POST parameters to a query string, saving that string in the default environment variable, then changing the environment variable that tells the server what method this request is using to GET.
$ENV{'QUERY_STRING'} = $long_parameter_string . '&' . $ENV{'QUERY_STRING'};
$ENV{'REQUEST_METHOD'} = 'GET';
system {$perl_exec} $cgi_script;
I'm essentially tricking the CGI module to read from the QUERY_STRING environment variable instead of from STDIN, which it would attempt to read POST requests from.
This method seems to work so far, but I'm worried about unintended repercussions.
My question is, do you see any potential problems with this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…