in reply to Why doesn't the system function pass the CGI parameters in?

The arguments don't get passed because CGI.pm only reads the command line arguments if $ENV{REQUEST_METHOD} is not set to GET, POST, or HEAD.

The redirection fails because the user the web server runs as doesn't have permission to write to the directory you are trying to redirect into (hence the abundantly clear error message 'temp.dat: Permission denied' which is helpfully provided.

You can work around the argument passing part by doing this in test8.pl:

print header(), start_html('test'); { local $ENV{REQUEST_METHOD}; print h1(system("./test7.pl name=5 val=4")); } print end_html();

As for the second part, you either need to make the directory writable by the web server user, or redirect into another directory (such as /tmp) which is writable.


We're not surrounded, we're in a target-rich environment!