http://qs321.pair.com?node_id=186299

cidaris has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks,

I'm attempting to auto-generate my site. I've written the program necessary to do what needs to happen, now I want to run it from the web.

Originally, I did this by having a call to
system ("/whatever/cgi-bin/generate.pl", $argument)
from another program, which worked OK, except the script called needs to generate output to the htdocs folder.
Since it was technically 'nobody' running the script (Apache) it didn't have permission to write to htdocs. Very briefly, I changed the permissions of the htdocs folder to be owned by nobody/nogroup and 777 permissions, but realized this was probably the worst idea ever.
Someone pointed me towards CGIWrap, but I don't think I'm doing it quite right.

I know I'm opening up a big can of worms with the whole setgid and setuid issues, so I was hoping someone could point me in the right direction?

Thanks again,
cidaris